From 923f94f691b7c7005988aeb5f74688cebf172a85 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Tue, 22 Jul 2014 19:41:50 -0700 Subject: [PATCH] Change addCategoryLinks() to use array_fill_keys Previously it used an ugly array_combine hack. Change-Id: I6bc4fb5cfffda468c61037588ebb4399b5121db5 --- includes/OutputPage.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 ) { -- 2.20.1