From cedb68a771605591c34b0c864f3553a7808b4f08 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Mon, 12 Nov 2007 22:34:39 +0000 Subject: [PATCH] 6x optimized lcfirst() \o/ though it would be far better not to call these functions too much at all :) --- languages/Language.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ) { -- 2.20.1