Withoutaname has uploaded a new change for review.
https://gerrit.wikimedia.org/r/148589
Change subject: Change addCategoryLinks() to use array_fill_keys
......................................................................
Change addCategoryLinks() to use array_fill_keys
Previously it used an ugly array_combine hack.
Change-Id: I6bc4fb5cfffda468c61037588ebb4399b5121db5
---
M includes/OutputPage.php
1 file changed, 2 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/89/148589/1
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 19b2240..29306f4 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -1266,11 +1266,8 @@
# 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 ) {
--
To view, visit https://gerrit.wikimedia.org/r/148589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6bc4fb5cfffda468c61037588ebb4399b5121db5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Withoutaname <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits