Skip to content

Commit

Permalink
Minor optimization on Inflector::variable
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 17, 2009
1 parent aa3a197 commit c8297ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/inflector.php
Expand Up @@ -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
Expand Down

0 comments on commit c8297ff

Please sign in to comment.