From: Niklas Laxström Date: Thu, 20 Jan 2011 07:38:30 +0000 (+0000) Subject: Kill some duplicated queries by also caching negative results in wasDeletedSinceLastEdit X-Git-Tag: 1.31.0-rc.0~32460 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27votes%27%2C%20votes=%27waiting%27%29%20%7D%7D?a=commitdiff_plain;h=91d472a490a9253939d9fb2d6147e3aaeca448fa;p=lhc%2Fweb%2Fwiklou.git Kill some duplicated queries by also caching negative results in wasDeletedSinceLastEdit --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 3f7ef96571..8c04326064 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -49,7 +49,7 @@ class EditPage { var $isCssJsSubpage = false; var $isCssSubpage = false; var $isJsSubpage = false; - var $deletedSinceEdit = false; + var $deletedSinceEdit; var $formtype; var $firsttime; var $lastDelete; @@ -260,8 +260,12 @@ class EditPage { * deletes. */ protected function wasDeletedSinceLastEdit() { - if ( $this->deletedSinceEdit ) - return true; + if ( $this->deletedSinceEdit !== null ) { + return $this->deletedSinceEdit; + } + + $this->deletedSinceEdit = false; + if ( $this->mTitle->isDeletedQuick() ) { $this->lastDelete = $this->getLastDelete(); if ( $this->lastDelete ) { @@ -271,6 +275,7 @@ class EditPage { } } } + return $this->deletedSinceEdit; }