r71966 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71965‎ | r71966 | r71967 >
Date:18:16, 30 August 2010
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Avoid stupid queries in LinkHolderArray

Title::isAlwaysKnown will return true for all existing special pages, so the rest don't exists
Modified paths:
  • /trunk/phase3/includes/parser/LinkHolderArray.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/LinkHolderArray.php
@@ -159,7 +159,7 @@
160160 $current = null;
161161 foreach ( $this->internals as $ns => $entries ) {
162162 foreach ( $entries as $index => $entry ) {
163 - $key = "$ns:$index";
 163+ $key = "$ns:$index";
164164 $title = $entry['title'];
165165 $pdbk = $entry['pdbk'];
166166
@@ -172,6 +172,8 @@
173173 # Check if it's a static known link, e.g. interwiki
174174 if ( $title->isAlwaysKnown() ) {
175175 $colours[$pdbk] = '';
 176+ } elseif ( $ns == NS_SPECIAL ) {
 177+ $colours[$pdbk] = 'new';
176178 } elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) {
177179 $colours[$pdbk] = $sk->getLinkColour( $title, $threshold );
178180 $output->addLink( $title, $id );

Comments

#Comment by MarkAHershberger (talk | contribs)   17:52, 5 January 2011

looks good to me.

Status & tagging log