http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73858

Revision: 73858
Author:   reedy
Date:     2010-09-28 01:21:15 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
Swap a couple of while loops for foreach

Modified Paths:
--------------
    trunk/phase3/includes/api/ApiQueryBlocks.php
    trunk/phase3/includes/api/ApiQueryTags.php

Modified: trunk/phase3/includes/api/ApiQueryBlocks.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryBlocks.php        2010-09-28 01:08:21 UTC 
(rev 73857)
+++ trunk/phase3/includes/api/ApiQueryBlocks.php        2010-09-28 01:21:15 UTC 
(rev 73858)
@@ -138,7 +138,7 @@
                $res = $this->select( __METHOD__ );
 
                $count = 0;
-               while ( $row = $res->fetchObject() ) {
+               foreach ( $res as $row ) {
                        if ( ++$count > $params['limit'] ) {
                                // We've had enough
                                $this->setContinueEnumParameter( 'start', 
wfTimestamp( TS_ISO_8601, $row->ipb_timestamp ) );

Modified: trunk/phase3/includes/api/ApiQueryTags.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryTags.php  2010-09-28 01:08:21 UTC (rev 
73857)
+++ trunk/phase3/includes/api/ApiQueryTags.php  2010-09-28 01:21:15 UTC (rev 
73858)
@@ -71,7 +71,7 @@
 
                $ok = true;
 
-               while ( $row = $res->fetchObject() ) {
+               foreach ( $res as $row ) {
                        if ( !$ok ) {
                                break;
                        }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to