Skip to content

skiplist: prevent Range iterator from rewinding after exhaustion#1252

Open
cong-or wants to merge 1 commit intocrossbeam-rs:masterfrom
cong-or:fix-skiplist-range-rewind
Open

skiplist: prevent Range iterator from rewinding after exhaustion#1252
cong-or wants to merge 1 commit intocrossbeam-rs:masterfrom
cong-or:fix-skiplist-range-rewind

Conversation

@cong-or
Copy link
Copy Markdown

@cong-or cong-or commented May 4, 2026

Fixes #1142 — Range iterators rewound to the first element after exhaustion.

When the bounds check failed, head was set to None. Next call interpreted
that as "haven't started yet" and searched from start_bound() again.

Added a finished flag to Range/RefRange, set only when bounds are
exceeded. Iter/RefIter left unchanged — their rewind on concurrent inserts
is intentional.

Also added FusedIterator impls for Range in base, map, and set.

@cong-or cong-or force-pushed the fix-skiplist-range-rewind branch from e586243 to 1ab7e07 Compare May 4, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

crossbeam_skiplist::Range rewinds to the head after it was exhausted

1 participant