From 05aac977eb17629df07f29bf874b23d852ccefff Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Tue, 19 May 2015 15:45:46 -0700 Subject: [PATCH] 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 --- includes/User.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 ) ); } } -- 2.20.1