6x optimized lcfirst() \o/ though it would be far better not to call these functions too much at all :)

This commit is contained in:
Domas Mituzas 2007-11-12 22:34:39 +00:00
parent 54a855b06e
commit cedb68a771

View file

@ -962,7 +962,12 @@ class Language {
}
function lcfirst( $str ) {
return self::lc( $str, true );
if ( ord($str[0]) < 128 ) {
// editing string in place = cool
$str[0]=strtolower($str[0]);
return $str;
}
else return self::lc( $str, true );
}
function lc( $str, $first = false ) {