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:
e84c975
)
count ( a ) , count ( a,b) , count (a,b,c) -> count++, faster smoother!!!
author
Domas Mituzas
<midom@users.mediawiki.org>
Tue, 10 Jan 2006 17:56:59 +0000
(17:56 +0000)
committer
Domas Mituzas
<midom@users.mediawiki.org>
Tue, 10 Jan 2006 17:56:59 +0000
(17:56 +0000)
includes/Title.php
patch
|
blob
|
history
diff --git
a/includes/Title.php
b/includes/Title.php
index
4649a4a
..
f79edbb
100644
(file)
--- 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 );