From fbc354d1107136305fa46469d76a56bc020de6fa Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 7 Jul 2012 16:45:24 +0200 Subject: [PATCH] Use Revision::getParentLengths in history Using new method from I6e388e75 Change-Id: I902dd1e2699c7291c49cd68fce271941ff4c6e34 --- includes/actions/HistoryAction.php | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) 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 * -- 2.20.1