Permalink
Browse files

Minor optimization on Inflector::variable

  • Loading branch information...
1 parent aa3a197 commit c8297ff283e03f7cd0cf1e25b75857271488b107 @markstory markstory committed Dec 17, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 cake/libs/inflector.php
View
2 cake/libs/inflector.php
@@ -481,7 +481,7 @@ function classify($tableName) {
function variable($string) {
$string = Inflector::camelize(Inflector::underscore($string));
$replace = strtolower(substr($string, 0, 1));
- return preg_replace('/\\w/', $replace, $string, 1);
+ return $replace . substr($string, 1);
}
/**
* Returns a string with all spaces converted to underscores (by default), accented

0 comments on commit c8297ff

Please sign in to comment.