From: Antoine Musso Date: Fri, 13 Jan 2012 23:10:21 +0000 (+0000) Subject: MWDebug: avoid double count() X-Git-Tag: 1.31.0-rc.0~25288 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=6fdbefa5211a1907af41cd8be891b3e0afd62c26;p=lhc%2Fweb%2Fwiklou.git MWDebug: avoid double count() Follow r107954 --- diff --git a/includes/debug/Debug.php b/includes/debug/Debug.php index d56b65bc23..664b4feabd 100644 --- a/includes/debug/Debug.php +++ b/includes/debug/Debug.php @@ -113,8 +113,9 @@ class MWDebug { // Check to see if there was already a deprecation notice, so not to // get a duplicate warning - if ( count( self::$log ) ) { - $lastLog = self::$log[ count( self::$log ) - 1 ]; + $logCount = count( self::$log ); + if ( $logCount ) { + $lastLog = self::$log[ $logCount - 1 ]; if ( $lastLog['type'] == 'deprecated' && $lastLog['caller'] == wfGetCaller( $callerOffset + 1 ) ) { return; }