SimpleQuery: Initialize self::$iteratorPosition as late as possible
refs #9632
This commit is contained in:
parent
6a17d7cb26
commit
dbc2f98053
|
@ -158,7 +158,7 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
|||
}
|
||||
|
||||
$this->iterator->rewind();
|
||||
$this->iteratorPosition = 0;
|
||||
$this->iteratorPosition = null;
|
||||
Benchmark::measure('Query result iteration started');
|
||||
}
|
||||
|
||||
|
@ -190,6 +190,8 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
|||
if (! $valid) {
|
||||
Benchmark::measure('Query result iteration finished');
|
||||
return false;
|
||||
} elseif ($this->iteratorPosition === null) {
|
||||
$this->iteratorPosition = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue