Use Revision::getParentLengths in history
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 7 Jul 2012 14:45:24 +0000 (16:45 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 7 Jul 2012 14:45:24 +0000 (16:45 +0200)
Using new method from I6e388e75

Change-Id: I902dd1e2699c7291c49cd68fce271941ff4c6e34

includes/actions/HistoryAction.php

index 6f48cd0..7393315 100644 (file)
@@ -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
         *