From: Roland Häder Date: Thu, 3 Dec 2020 23:36:52 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ac256a664aa490665d37705439807ab6d62a7e3a;p=core.git Continued: - next() needs to increase current position and then check if it is still valid Signed-off-by: Roland Häder --- diff --git a/framework/main/classes/database/result/class_CachedDatabaseResult.php b/framework/main/classes/database/result/class_CachedDatabaseResult.php index 80fe8d05..03af7c2c 100644 --- a/framework/main/classes/database/result/class_CachedDatabaseResult.php +++ b/framework/main/classes/database/result/class_CachedDatabaseResult.php @@ -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; }