From: Domas Mituzas Date: Mon, 12 Nov 2007 22:50:05 +0000 (+0000) Subject: empty() is faster! :) X-Git-Tag: 1.31.0-rc.0~50896 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=06907a073ab70de83a9d3a5e7c4c54060ae20098;p=lhc%2Fweb%2Fwiklou.git empty() is faster! :) --- diff --git a/languages/Language.php b/languages/Language.php index a91ce2e0df..290e22da70 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -931,7 +931,7 @@ class Language { } function ucfirst( $str ) { - if ($str == "") return ""; + if (empty($str)) return ""; 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 } @@ -963,7 +963,7 @@ class Language { } function lcfirst( $str ) { - if ($str == "") return ""; + if (empty($str)) return ""; if ( ord($str[0]) < 128 ) { // editing string in place = cool $str[0]=strtolower($str[0]);