]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 3 Dec 2020 23:36:52 +0000 (00:36 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 3 Dec 2020 23:36:52 +0000 (00:36 +0100)
- next() needs to increase current position and then check if it is still valid

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/database/result/class_CachedDatabaseResult.php

index 80fe8d05df7a3904c56145727c795af655071b37..03af7c2c702e9cc507fb03084bbbddb5258b241c 100644 (file)
@@ -153,10 +153,12 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
                // Default is not valid
                $nextValid = false;
 
+               // Increase position
+               $this->currentPos++;
+
                // Is the result valid?
                if ($this->valid()) {
-                       // Next entry found, so count one up and cache it
-                       $this->currentPos++;
+                       // Next entry found, so cache it
                        $this->currentRow = $this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][$this->currentPos];
                        $nextValid = true;
                }