From: Domas Mituzas Date: Mon, 12 Nov 2007 22:34:39 +0000 (+0000) Subject: 6x optimized lcfirst() \o/ though it would be far better not to call these functions... X-Git-Tag: 1.31.0-rc.0~50900 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=cedb68a771605591c34b0c864f3553a7808b4f08;p=lhc%2Fweb%2Fwiklou.git 6x optimized lcfirst() \o/ though it would be far better not to call these functions too much at all :) --- diff --git a/languages/Language.php b/languages/Language.php index a2d313f967..bbdbbc5b64 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 ) {