r78166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78165‎ | r78166 | r78167 >
Date:03:23, 10 December 2010
Author:aaron
Status:ok
Tags:
Comment:
Cleanup return type for getStableRev() given r78092
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -275,21 +275,18 @@
276276 /**
277277 * Get the stable revision
278278 * @param int $flags
279 - * @return mixed (FlaggedRevision/false)
 279+ * @return mixed (FlaggedRevision/null)
280280 */
281281 public function getStableRev( $flags = 0 ) {
282282 # Cached results available?
283 - if ( !( $flags & FR_MASTER ) && $this->stableRev !== null ) {
 283+ if ( $this->stableRev == null || ( $flags & FR_MASTER ) ) {
 284+ $srev = FlaggedRevision::newFromStable( $this->getTitle(), $flags );
 285+ $this->stableRev = $srev ? $srev : false; // false => "found nothing"
 286+ }
 287+ if ( $this->stableRev ) {
284288 return $this->stableRev;
285289 }
286 - # Do we have one?
287 - $srev = FlaggedRevision::newFromStable( $this->getTitle(), $flags );
288 - if ( $srev ) {
289 - $this->stableRev = $srev;
290 - } else {
291 - $this->stableRev = false;
292 - }
293 - return $this->stableRev;
 290+ return null;
294291 }
295292
296293 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r78729Merged r78166 from trunk (bug 15515)pdhanda19:57, 21 December 2010
r80733MFT first round of FlaggedRevs fixes r78517, r78346, r78319, r78293, r78226, ...demon23:56, 21 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78092Improved getDiffRevMsgAndClass() for bug 15515aaron19:42, 8 December 2010

Status & tagging log