r86380 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86379‎ | r86380 | r86381 >
Date:07:36, 19 April 2011
Author:aaron
Status:ok
Tags:
Comment:
Short-circuit some commonly called functions with inReviewNamespace()
Modified paths:
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedPage.php
@@ -280,6 +280,9 @@
281281 * @return int
282282 */
283283 public function getStable() {
 284+ if ( !FlaggedRevs::inReviewNamespace( $this->mTitle ) ) {
 285+ return 0; // short-circuit
 286+ }
284287 if ( !$this->mDataLoaded ) {
285288 $this->loadPageData();
286289 }
@@ -291,6 +294,9 @@
292295 * @return mixed (FlaggedRevision/null)
293296 */
294297 public function getStableRev() {
 298+ if ( !FlaggedRevs::inReviewNamespace( $this->mTitle ) ) {
 299+ return null; // short-circuit
 300+ }
295301 if ( !$this->mDataLoaded ) {
296302 $this->loadPageData();
297303 }

Status & tagging log