Merge "LocalisationCache::recache(): Use array_fill_keys()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 9 Oct 2015 06:17:07 +0000 (06:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 9 Oct 2015 06:17:07 +0000 (06:17 +0000)
includes/cache/LocalisationCache.php

index f5b2350..fa5e288 100644 (file)
@@ -816,9 +816,7 @@ class LocalisationCache {
                $this->recachedLangs[$code] = true;
 
                # Initial values
-               $initialData = array_combine(
-                       self::$allKeys,
-                       array_fill( 0, count( self::$allKeys ), null ) );
+               $initialData = array_fill_keys( self::$allKeys, null );
                $coreData = $initialData;
                $deps = array();
 
@@ -856,9 +854,7 @@ class LocalisationCache {
                $messageDirs = $this->getMessagesDirs();
 
                # Load non-JSON localisation data for extensions
-               $extensionData = array_combine(
-                       $codeSequence,
-                       array_fill( 0, count( $codeSequence ), $initialData ) );
+               $extensionData = array_fill_keys( $codeSequence, $initialData );
                foreach ( $wgExtensionMessagesFiles as $extension => $fileName ) {
                        if ( isset( $messageDirs[$extension] ) ) {
                                # This extension has JSON message data; skip the PHP shim