From cd5c1a59a158ad8b3e5c8a682dfe8c081ac05a37 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 28 Sep 2010 01:21:15 +0000 Subject: [PATCH] Swap a couple of while loops for foreach --- includes/api/ApiQueryBlocks.php | 2 +- includes/api/ApiQueryTags.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.20.1