Swap a couple of while loops for foreach
authorSam Reed <reedy@users.mediawiki.org>
Tue, 28 Sep 2010 01:21:15 +0000 (01:21 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 28 Sep 2010 01:21:15 +0000 (01:21 +0000)
includes/api/ApiQueryBlocks.php
includes/api/ApiQueryTags.php

index 9661f32..f0da49c 100644 (file)
@@ -138,7 +138,7 @@ class ApiQueryBlocks extends ApiQueryBase {
                $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 ) );
index af79d5c..eec15fb 100644 (file)
@@ -71,7 +71,7 @@ class ApiQueryTags extends ApiQueryBase {
 
                $ok = true;
 
-               while ( $row = $res->fetchObject() ) {
+               foreach ( $res as $row ) {
                        if ( !$ok ) {
                                break;
                        }