r75480 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75479‎ | r75480 | r75481 >
Date:22:32, 26 October 2010
Author:reedy
Status:resolved
Tags:
Comment:
Swap some more while loops for foreach
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -569,7 +569,7 @@
570570 'fr_page_id = fp_page_id AND fr_rev_id = fp_stable' )
571571 )
572572 );
573 - while ( $row = $res->fetchObject() ) {
 573+ foreach ( $res as $row )
574574 $reviewedTS = '0';
575575 $reviewedSha1 = '';
576576 if ( $row->fr_img_timestamp ) {
Index: trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php
@@ -175,7 +175,7 @@
176176
177177 $feed->outHeader();
178178 if ( $pager->getNumRows() > 0 ) {
179 - while ( $row = $pager->mResult->fetchObject() ) {
 179+ foreach ( $pager->mResult as $row ) {
180180 $feed->outItem( $this->feedItem( $row ) );
181181 }
182182 }
@@ -423,7 +423,7 @@
424424 wfProfileIn( __METHOD__ );
425425 # Do a link batch query
426426 $lb = new LinkBatch();
427 - while ( $row = $this->mResult->fetchObject() ) {
 427+ foreach ( $this->mResult as $row ) {
428428 $lb->add( $row->page_namespace, $row->page_title );
429429 }
430430 $lb->execute();
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -354,7 +354,7 @@
355355 wfProfileIn( __METHOD__ );
356356 # Do a link batch query
357357 $lb = new LinkBatch();
358 - while ( $row = $this->mResult->fetchObject() ) {
 358+ foreach ( $this->mResult as $row ) {
359359 $lb->add( $row->page_namespace, $row->page_title );
360360 }
361361 $lb->execute();
Index: trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php
@@ -176,7 +176,7 @@
177177 wfProfileIn( __METHOD__ );
178178 # Do a link batch query
179179 $lb = new LinkBatch();
180 - while ( $row = $this->mResult->fetchObject() ) {
 180+ foreach ( $this->mResult as $row ) {
181181 $lb->add( $row->page_namespace, $row->page_title );
182182 }
183183 $lb->execute();
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -136,7 +136,7 @@
137137
138138 $feed->outHeader();
139139 if ( $pager->getNumRows() > 0 ) {
140 - while ( $row = $pager->mResult->fetchObject() ) {
 140+ foreach ( $pager->mResult as $row ) {
141141 $feed->outItem( $this->feedItem( $row ) );
142142 }
143143 }
@@ -375,7 +375,7 @@
376376 wfProfileIn( __METHOD__ );
377377 # Do a link batch query
378378 $lb = new LinkBatch();
379 - while ( $row = $this->mResult->fetchObject() ) {
 379+ foreach ( $this->mResult as $row ) {
380380 $lb->add( $row->page_namespace, $row->page_title );
381381 }
382382 $lb->execute();
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php
@@ -173,7 +173,7 @@
174174 wfProfileIn( __METHOD__ );
175175 # Do a link batch query
176176 $lb = new LinkBatch();
177 - while ( $row = $this->mResult->fetchObject() ) {
 177+ foreach ( $this->mResult as $row ) {
178178 $lb->add( $row->page_namespace, $row->page_title );
179179 }
180180 $lb->execute();
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -173,7 +173,7 @@
174174 wfProfileIn( __METHOD__ );
175175 # Do a link batch query
176176 $lb = new LinkBatch();
177 - while ( $row = $this->mResult->fetchObject() ) {
 177+ foreach ( $this->mResult as $row ) {
178178 $lb->add( $row->page_namespace, $row->page_title );
179179 }
180180 $lb->execute();

Follow-up revisions

RevisionCommit summaryAuthorDate
r75482Fixup fail from r75480, add missing bracereedy22:38, 26 October 2010

Status & tagging log