r44043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44042‎ | r44043 | r44044 >
Date:18:31, 29 November 2008
Author:aaron
Status:ok
Tags:
Comment:
Remove unneeded function
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -584,8 +584,7 @@
585585 if( !$flaggedArticle->showStableByDefault() ) {
586586 return true;
587587 }
588 - $frev = $flaggedArticle->getStableRev();
589 - if( $frev ) {
 588+ if( $frev = $flaggedArticle->getStableRev() ) {
590589 # Allow for only editors/reviewers to move this
591590 if( !$user->isAllowed('review') && !$user->isAllowed('movestable') ) {
592591 $result = false;
@@ -652,7 +651,7 @@
653652 # Avoid extra DB hit and lag issues
654653 $title->resetArticleID( $rev->getPage() );
655654 # Get what was just the current revision ID
656 - $prevRevId = self::getPreviousRevisionId( $rev );
 655+ $prevRevId = $rev->getParentId();
657656 # Get the revision ID the incoming one was based off...
658657 if( !$baseRevId && $prevRevId ) {
659658 $prevTimestamp = Revision::getTimestampFromId( $title, $prevRevId ); // use PK
@@ -701,28 +700,9 @@
702701 }
703702 return true;
704703 }
705 -
706 - /**
707 - * As used, this function should be lag safe
708 - * @param Revision $revision
709 - * @return int
710 - */
711 - protected static function getPreviousRevisionID( $revision ) {
712 - $db = wfGetDB( DB_MASTER );
713 - return $db->selectField( 'revision', 'rev_id',
714 - array(
715 - 'rev_page' => $revision->getPage(),
716 - 'rev_id < ' . $revision->getId()
717 - ),
718 - __METHOD__,
719 - array( 'ORDER BY' => 'rev_id DESC' )
720 - );
721 - }
722704
723705 /**
724706 * When an edit is made to a page that can't be reviewed, autopatrol if allowed.
725 - * This is not loggged for perfomance reasons and no one cares if talk pages and such
726 - * are autopatrolled.
727707 */
728708 public static function autoMarkPatrolled( $rc ) {
729709 global $wgUser;

Status & tagging log