From: withoutaname Date: Wed, 23 Jul 2014 02:41:50 +0000 (-0700) Subject: Change addCategoryLinks() to use array_fill_keys X-Git-Tag: 1.31.0-rc.0~14653^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=923f94f691b7c7005988aeb5f74688cebf172a85;p=lhc%2Fweb%2Fwiklou.git Change addCategoryLinks() to use array_fill_keys Previously it used an ugly array_combine hack. Change-Id: I6bc4fb5cfffda468c61037588ebb4399b5121db5 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a64d04928d..039342535f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1266,11 +1266,8 @@ class OutputPage extends ContextSource { # Add the results to the link cache $lb->addResultToCache( LinkCache::singleton(), $res ); - # Set all the values to 'normal'. This can be done with array_fill_keys in PHP 5.2.0+ - $categories = array_combine( - array_keys( $categories ), - array_fill( 0, count( $categories ), 'normal' ) - ); + # Set all the values to 'normal'. + $categories = array_fill_keys( array_keys( $categories ), 'normal' ); # Mark hidden categories foreach ( $res as $row ) {