dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3dbd23
)
8x faster ucfirst() (function called >100 times even on simple pageviews :)
author
Domas Mituzas
<midom@users.mediawiki.org>
Mon, 12 Nov 2007 22:17:50 +0000
(22:17 +0000)
committer
Domas Mituzas
<midom@users.mediawiki.org>
Mon, 12 Nov 2007 22:17:50 +0000
(22:17 +0000)
languages/Language.php
patch
|
blob
|
history
diff --git
a/languages/Language.php
b/languages/Language.php
index
338c348
..
a2d313f
100644
(file)
--- a/
languages/Language.php
+++ b/
languages/Language.php
@@
-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 ) {