r100325 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100324‎ | r100325 | r100326 >
Date:02:26, 20 October 2011
Author:aaron
Status:ok
Tags:
Comment:
Moved contribs rev parent ID batch query into doBatchLookups()
Modified paths:
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -549,6 +549,18 @@
550550 }
551551
552552 function doBatchLookups() {
 553+ global $wgRCShowChangedSize;
 554+
 555+ $this->mParentLens = array();
 556+ if ( $wgRCShowChangedSize ) {
 557+ $this->mResult->rewind();
 558+ $revIds = array();
 559+ foreach ( $this->mResult as $row ) {
 560+ $revIds[] = $row->rev_parent_id;
 561+ }
 562+ $this->mParentLens = $this->getParentLengths( $revIds );
 563+ $this->mResult->rewind(); // reset
 564+ }
553565 if ( $this->contribs === 'newbie' ) { // multiple users
554566 # Do a link batch query
555567 $this->mResult->seek( 0 );
@@ -563,32 +575,6 @@
564576 }
565577 }
566578
567 - function getStartBody() {
568 - return "<ul>\n";
569 - }
570 -
571 - function getEndBody() {
572 - return "</ul>\n";
573 - }
574 -
575 - function getBody() {
576 - global $wgRCShowChangedSize;
577 - if( !$this->mQueryDone ) {
578 - $this->doQuery();
579 - }
580 - $this->mParentLens = array();
581 - if( $wgRCShowChangedSize ) {
582 - $this->mResult->rewind();
583 - $revIds = array();
584 - foreach( $this->mResult as $row ) {
585 - $revIds[] = $row->rev_parent_id;
586 - }
587 - $this->mParentLens = $this->getParentLengths( $revIds );
588 - $this->mResult->rewind();
589 - }
590 - return parent::getBody();
591 - }
592 -
593579 /*
594580 * Do a batched query to get the parent revision lengths
595581 */
@@ -609,6 +595,14 @@
610596 return $revLens;
611597 }
612598
 599+ function getStartBody() {
 600+ return "<ul>\n";
 601+ }
 602+
 603+ function getEndBody() {
 604+ return "</ul>\n";
 605+ }
 606+
613607 /**
614608 * Generates each row in the contributions list.
615609 *
Index: trunk/phase3/includes/Pager.php
@@ -388,8 +388,9 @@
389389 }
390390
391391 /**
392 - * Called from getBody(), before getStartBody() is called. This
393 - * will be called even if there are no rows in the result set.
 392+ * Called from getBody(), before getStartBody() is called and
 393+ * after doQuery() was called. This will be called even if there
 394+ * are no rows in the result set.
394395 *
395396 * @return void
396397 */

Sign-offs

UserFlagDate
Bawolffinspected05:50, 20 December 2011
Bawolfftested05:50, 20 December 2011

Status & tagging log