From 53c5e4b942ddd7a726ebfc00e7c696239a93c2a9 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 20 Jun 2010 18:52:46 +0000 Subject: [PATCH] Do ApiQueryAllUsers per r68337 (was using while (true)..) --- includes/api/ApiQueryAllUsers.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index fcb8ba18d7..b138425c27 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -128,9 +128,9 @@ class ApiQueryAllUsers extends ApiQueryBase { // Otherwise, the group of the new row is appended to the last entry. // The setContinue... is more complex because of this, and takes into account the higher sql limit // to make sure all rows that belong to the same user are received. - // - while ( true ) { - $row = $db->fetchObject( $res ); + + $row = $db->fetchObject( $res ); + foreach ( $res as $row ) { $count++; if ( !$row || $lastUser !== $row->user_name ) { @@ -145,11 +145,6 @@ class ApiQueryAllUsers extends ApiQueryBase { } } - // No more rows left - if ( !$row ) { - break; - } - if ( $count > $limit ) { // We've reached the one extra which shows that there are additional pages to be had. Stop here... $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->user_name ) ); -- 2.20.1