From 7d4a930c95cce41cdea2774375ee7f5aa6a99623 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 1 Oct 2015 03:32:01 -0700 Subject: [PATCH] Made WikiPage::isRedirect() actually use page_is_redirect * Previously it would always fetch the whole content, which is silly since followRedirect() uses the redirect table to avoid loading the text. The initializeArticle() uses isRedirect() and then possibly followRedirect(). It makes no sense for the former to fetch all the text anway. * The time fetching the text showed up on xenon flamegraphs. Change-Id: I2dc216f36d3a0ea2285e64122b4d07bd9c8ae703 --- includes/page/WikiPage.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 708a8755e5..d3978eac7f 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -469,12 +469,11 @@ class WikiPage implements Page, IDBAccessObject { * @return bool */ public function isRedirect() { - $content = $this->getContent(); - if ( !$content ) { - return false; + if ( !$this->mDataLoaded ) { + $this->loadPageData(); } - return $content->isRedirect(); + return (bool)$this->mIsRedirect; } /** -- 2.20.1