From 5cef8327aff3ab0e3c486ca5035da2cf20eeb10a Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Sun, 27 Apr 2025 02:48:40 +0200 Subject: [PATCH] Bugfix in the Iterator --- include/sqlgen/Iterator.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/sqlgen/Iterator.hpp b/include/sqlgen/Iterator.hpp index ccbd0b8..0a0bb27 100644 --- a/include/sqlgen/Iterator.hpp +++ b/include/sqlgen/Iterator.hpp @@ -40,17 +40,16 @@ class Iterator { Result* operator->() const noexcept { return &(*current_batch_)[ix_]; } bool operator==(const End&) const noexcept { - return ix_ >= current_batch_->size() && it_->end(); + return ix_ >= current_batch_->size(); } bool operator!=(const End& _end) const noexcept { return !(*this == _end); } Iterator& operator++() noexcept { + ++ix_; if (ix_ >= current_batch_->size() && !it_->end()) { current_batch_ = get_next_batch(it_); ix_ = 0; - } else { - ++ix_; } return *this; }