6x optimized lcfirst() \o/ though it would be far better not to call these functions...
authorDomas Mituzas <midom@users.mediawiki.org>
Mon, 12 Nov 2007 22:34:39 +0000 (22:34 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Mon, 12 Nov 2007 22:34:39 +0000 (22:34 +0000)
languages/Language.php

index a2d313f..bbdbbc5 100644 (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 ) {