From: Robert Stojnić Date: Thu, 14 Dec 2006 01:06:28 +0000 (+0000) Subject: Small patch to minimize the number of category variants need to be fetched. X-Git-Tag: 1.31.0-rc.0~54908 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=650c9d1e12eae89d959c76849f066496b39e6267;p=lhc%2Fweb%2Fwiklou.git Small patch to minimize the number of category variants need to be fetched. --- diff --git a/includes/Parser.php b/includes/Parser.php index e01b0f815b..7e594f1bbe 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4083,10 +4083,12 @@ class Parser foreach( $categories as $category){ $variants = $wgContLang->convertLinkToAllVariants($category); foreach($variants as $variant){ - $variantTitle = Title::newFromDBkey( Title::makeName(NS_CATEGORY,$variant) ); - if(is_null($variantTitle)) continue; - $linkBatch->addObj( $variantTitle ); - $categoryMap[$variant] = $category; + if($variant != $category){ + $variantTitle = Title::newFromDBkey( Title::makeName(NS_CATEGORY,$variant) ); + if(is_null($variantTitle)) continue; + $linkBatch->addObj( $variantTitle ); + $categoryMap[$variant] = $category; + } } }