From: Ori Livneh Date: Tue, 19 May 2015 22:45:46 +0000 (-0700) Subject: User::clearSharedCache: don't load the full user record for just the ID X-Git-Tag: 1.31.0-rc.0~11356 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=05aac977eb17629df07f29bf874b23d852ccefff;p=lhc%2Fweb%2Fwiklou.git User::clearSharedCache: don't load the full user record for just the ID Rather than call $this->load() unconditionally, get just the ID via $this->getId(), potentially saving us a database lookup. Change-Id: Ifa3b96956a1d66d3e877573ff01970758fad8790 --- diff --git a/includes/User.php b/includes/User.php index 79021196e6..eb2a2dc2ed 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2301,11 +2301,10 @@ class User implements IDBAccessObject { * Called implicitly from invalidateCache() and saveSettings(). */ public function clearSharedCache() { - $this->load(); - if ( $this->mId ) { + $id = $this->getId(); + if ( $id ) { $cache = ObjectCache::getMainWANInstance(); - - $cache->delete( wfMemcKey( 'user', 'id', $this->mId ) ); + $cache->delete( wfMemcKey( 'user', 'id', $id ) ); } }