SimpleQuery: Initialize self::$iteratorPosition as late as possible

refs #9632
This commit is contained in:
Johannes Meyer 2015-08-03 14:09:55 +02:00
parent 6a17d7cb26
commit dbc2f98053
1 changed files with 3 additions and 1 deletions

View File

@ -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;