From: Sam Reed Date: Tue, 28 Sep 2010 01:21:15 +0000 (+0000) Subject: Swap a couple of while loops for foreach X-Git-Tag: 1.31.0-rc.0~34775 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=cd5c1a59a158ad8b3e5c8a682dfe8c081ac05a37;p=lhc%2Fweb%2Fwiklou.git Swap a couple of while loops for foreach --- diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 9661f32bef..f0da49ca67 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -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 ) ); diff --git a/includes/api/ApiQueryTags.php b/includes/api/ApiQueryTags.php index af79d5ca32..eec15fbc13 100644 --- a/includes/api/ApiQueryTags.php +++ b/includes/api/ApiQueryTags.php @@ -71,7 +71,7 @@ class ApiQueryTags extends ApiQueryBase { $ok = true; - while ( $row = $res->fetchObject() ) { + foreach ( $res as $row ) { if ( !$ok ) { break; }