MWDebug: avoid double count()
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 13 Jan 2012 23:10:21 +0000 (23:10 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 13 Jan 2012 23:10:21 +0000 (23:10 +0000)
Follow r107954

includes/debug/Debug.php

index d56b65b..664b4fe 100644 (file)
@@ -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;
                        }