From 6515e1fd6599964de6191aedbf5dd0daf8e3ebce Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 21 Jul 2015 14:19:12 -0700 Subject: [PATCH] Avoid an extra memcached lookup in MWEchoNotifUser::getNotificationCount() Change-Id: I32eb79beb494710c35b175f2dc15af42bdad61d7 --- includes/NotifUser.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/NotifUser.php b/includes/NotifUser.php index 4901faf72..7e6c2593b 100644 --- a/includes/NotifUser.php +++ b/includes/NotifUser.php @@ -245,8 +245,11 @@ class MWEchoNotifUser { $wgEchoConfig['version'] ); - if ( $cached && $this->cache->get( $memcKey ) !== false ) { - return (int)$this->cache->get( $memcKey ); + if ( $cached ) { + $data = $this->cache->get( $memcKey ); + if ( $data !== false ) { + return (int)$data; + } } $attributeManager = EchoAttributeManager::newFromGlobalVars();