From: Domas Mituzas Date: Tue, 10 Jan 2006 17:56:59 +0000 (+0000) Subject: count ( a ) , count ( a,b) , count (a,b,c) -> count++, faster smoother!!! X-Git-Tag: 1.6.0~630 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=89e89e69b9be08386134c2548e883b604d808275;p=lhc%2Fweb%2Fwiklou.git count ( a ) , count ( a,b) , count (a,b,c) -> count++, faster smoother!!! --- diff --git a/includes/Title.php b/includes/Title.php index 4649a4ae99..f79edbbcc5 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -135,12 +135,15 @@ class Title { $t->mDbkeyform = str_replace( ' ', '_', $filteredText ); $t->mDefaultNamespace = $defaultNamespace; + static $cachedcount = 0 ; if( $t->secureAndSplit() ) { if( $defaultNamespace == NS_MAIN ) { - if( count( $wgTitleCache ) >= MW_TITLECACHE_MAX ) { + if( $cachedcount >= MW_TITLECACHE_MAX ) { # Avoid memory leaks on mass operations... $wgTitleCache = array(); + $cachedcount=0; } + $cachedcount++; $wgTitleCache[$text] =& $t; } wfProfileOut( $fname );