r80618 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80617‎ | r80618 | r80619 >
Date:07:38, 20 January 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Kill some duplicated queries by also caching negative results in wasDeletedSinceLastEdit
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -49,7 +49,7 @@
5050 var $isCssJsSubpage = false;
5151 var $isCssSubpage = false;
5252 var $isJsSubpage = false;
53 - var $deletedSinceEdit = false;
 53+ var $deletedSinceEdit;
5454 var $formtype;
5555 var $firsttime;
5656 var $lastDelete;
@@ -260,8 +260,12 @@
261261 * deletes.
262262 */
263263 protected function wasDeletedSinceLastEdit() {
264 - if ( $this->deletedSinceEdit )
265 - return true;
 264+ if ( $this->deletedSinceEdit !== null ) {
 265+ return $this->deletedSinceEdit;
 266+ }
 267+
 268+ $this->deletedSinceEdit = false;
 269+
266270 if ( $this->mTitle->isDeletedQuick() ) {
267271 $this->lastDelete = $this->getLastDelete();
268272 if ( $this->lastDelete ) {
@@ -271,6 +275,7 @@
272276 }
273277 }
274278 }
 279+
275280 return $this->deletedSinceEdit;
276281 }
277282

Status & tagging log