dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
845564a
)
Merge "user: Move idFromName cache truncation to before adding the new value"
author
jenkins-bot
<jenkins-bot@gerrit.wikimedia.org>
Fri, 14 Jun 2019 18:17:23 +0000
(18:17 +0000)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Fri, 14 Jun 2019 18:17:23 +0000
(18:17 +0000)
includes/user/User.php
patch
|
blob
|
history
diff --git
a/includes/user/User.php
b/includes/user/User.php
index
e5dfceb
..
2de90ed
100644
(file)
--- a/
includes/user/User.php
+++ b/
includes/user/User.php
@@
-950,12
+950,12
@@
class User implements IDBAccessObject, UserIdentity {
$result = (int)$s->user_id;
}
- self::$idCacheByName[$name] = $result;
-
- if ( count( self::$idCacheByName ) > 1000 ) {
+ if ( count( self::$idCacheByName ) >= 1000 ) {
self::$idCacheByName = [];
}
+ self::$idCacheByName[$name] = $result;
+
return $result;
}