Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iterator): ensure HasNext does not advance state #47

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

plar
Copy link
Owner

@plar plar commented Dec 16, 2024

This PR resolves issue #46.

  • Refactored bufferedIterator to make HasNext idempotent.
  • Added peek logic to prefetch the next valid node without advancing.
  • Updated HasNext and Next to align with the expected behavior in docs.
  • Added test cases to verify HasNext idempotency and empty iterator behavior.

- Refactored bufferedIterator to make HasNext idempotent.
- Added peek logic to prefetch the next valid node without advancing.
- Updated HasNext and Next to align with the expected behavior in docs.
- Added test cases to verify HasNext idempotency and empty iterator behavior.

Signed-off-by: Pavel Larkin <[email protected]>
@plar plar added the bug label Dec 16, 2024
@plar plar self-assigned this Dec 16, 2024
@plar plar merged commit 51b2cc7 into master Dec 16, 2024
6 checks passed
@plar plar deleted the fix-has-next branch December 16, 2024 19:33
plar added a commit that referenced this pull request Dec 16, 2024
- Refactored bufferedIterator to make HasNext idempotent.
- Added peek logic to prefetch the next valid node without advancing.
- Updated HasNext and Next to align with the expected behavior in docs.
- Added test cases to verify HasNext idempotency and empty iterator behavior.

Signed-off-by: Pavel Larkin <[email protected]>
@plar plar linked an issue Dec 16, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HasNext() advances iterators position
1 participant