MINOR: only call next() in iterator validation on initialisation or after reset NOT if current value is invalid

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110190 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andreas Piening 2010-08-30 03:52:19 +00:00 committed by Sam Minnee
parent 7bf9258dac
commit 3a210c397a

View File

@ -943,7 +943,7 @@ abstract class SS_Query implements Iterator {
* @return boolean
*/
public function valid() {
if(!$this->currentRecord) $this->next();
if(!$this->queryHasBegun) $this->next();
return $this->currentRecord !== false;
}