From: umherirrender Date: Sat, 7 Jul 2012 14:45:24 +0000 (+0200) Subject: Use Revision::getParentLengths in history X-Git-Tag: 1.31.0-rc.0~23104^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=fbc354d1107136305fa46469d76a56bc020de6fa;p=lhc%2Fweb%2Fwiklou.git Use Revision::getParentLengths in history Using new method from I6e388e75 Change-Id: I902dd1e2699c7291c49cd68fce271941ff4c6e34 --- diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 6f48cd00e2..73933157d0 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -418,34 +418,11 @@ class HistoryPager extends ReverseChronologicalPager { $batch->add( NS_USER_TALK, $row->rev_user_text ); } } - $this->parentLens = $this->getParentLengths( $revIds ); + $this->parentLens = Revision::getParentLengths( $this->mDb, $revIds ); $batch->execute(); $this->mResult->seek( 0 ); } - /** - * Do a batched query to get the parent revision lengths - * @param $revIds array - * @return array - * @TODO: stolen from Contributions, refactor - */ - private function getParentLengths( array $revIds ) { - $revLens = array(); - if ( !$revIds ) { - return $revLens; // empty - } - wfProfileIn( __METHOD__ ); - $res = $this->mDb->select( 'revision', - array( 'rev_id', 'rev_len' ), - array( 'rev_id' => $revIds ), - __METHOD__ ); - foreach ( $res as $row ) { - $revLens[$row->rev_id] = $row->rev_len; - } - wfProfileOut( __METHOD__ ); - return $revLens; - } - /** * Creates begin of history list with a submit button *