mirror of
https://github.com/predis/predis.git
synced 2026-09-05 07:16:44 +00:00
Rework PR to use "goto" instead of a "while ... do" loop.
This commit is contained in:
@@ -165,9 +165,7 @@ abstract class CursorBasedIterator implements Iterator
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
do {
|
||||
$more = false;
|
||||
|
||||
tryFetch: {
|
||||
if (!$this->elements && $this->fetchmore) {
|
||||
$this->fetch();
|
||||
}
|
||||
@@ -175,11 +173,11 @@ abstract class CursorBasedIterator implements Iterator
|
||||
if ($this->elements) {
|
||||
$this->extractNext();
|
||||
} elseif ($this->cursor) {
|
||||
$more = true;
|
||||
goto tryFetch;
|
||||
} else {
|
||||
$this->valid = false;
|
||||
}
|
||||
} while ($more);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user