8x faster ucfirst() (function called >100 times even on simple pageviews :)
This commit is contained in:
parent
a3dbd2377a
commit
54a855b06e
1 changed files with 2 additions and 1 deletions
|
|
@ -931,7 +931,8 @@ class Language {
|
|||
}
|
||||
|
||||
function ucfirst( $str ) {
|
||||
return self::uc( $str, true );
|
||||
if ( ord($str[0]) < 128 ) return ucfirst($str);
|
||||
else return self::uc($str,true); // fall back to more complex logic in case of multibyte strings
|
||||
}
|
||||
|
||||
function uc( $str, $first = false ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue