From df8c25e288cfbefc82ebf6988c7f2a88db9949da Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 24 Jul 2012 14:44:27 +0200 Subject: [PATCH] Do checks in the correct order in Linker::getLinkColour(). There's no point doing potentially expensive checks (exists() and getLength()) if the page is simply not in a content namespace. Change-Id: I86a2b3a36071cf508b8e99ef20bdf3e0e20f3c82 --- includes/Linker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 53551402fb..083845dc04 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -139,9 +139,9 @@ class Linker { if ( $t->isRedirect() ) { # Page is a redirect $colour = 'mw-redirect'; - } elseif ( $threshold > 0 && - $t->exists() && $t->getLength() < $threshold && - $t->isContentPage() ) { + } elseif ( $threshold > 0 && $t->isContentPage() && + $t->exists() && $t->getLength() < $threshold + ) { # Page is a stub $colour = 'stub'; } -- 2.20.1