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:
61544d6
)
user: Move idFromName cache truncation to before adding the new value
author
Alexia E. Smith
<washuu@gmail.com>
Fri, 14 Jun 2019 17:40:54 +0000
(12:40 -0500)
committer
Krinkle
<krinklemail@gmail.com>
Fri, 14 Jun 2019 18:05:26 +0000
(18:05 +0000)
This prevents a double query for the same User::idFromName() call
twice in a row.
Bug: T225843
Change-Id: I5beb0a3ad5e715b68dd8a450408fb089184fa6ce
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;
}