You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I found that the implementation of the Iterator trait for Range will rewind to the head after it is exhausted. The test case below can reproduce this behavior. Is it an expected behavior or should this be a bug?
#[test]fnrange(){usecrate::Bound::*;let guard = &epoch::pin();let s = SkipList::new(epoch::default_collector().clone());let v = (0..10).map(|x| x *10).collect::<Vec<_>>();for&x in v.iter(){
s.insert(x, x, guard).release(guard);}letmut it = s.range(..=5, guard);for _ent in&mut it {}let ent = it.next();assert!(ent.is_none(), "{ent:?}");// panic, but why? it should be none, but yield the first element Entry(0, 0) again}
The text was updated successfully, but these errors were encountered:
Hi, I found that the implementation of the
Iterator
trait forRange
will rewind to the head after it is exhausted. The test case below can reproduce this behavior. Is it an expected behavior or should this be a bug?The text was updated successfully, but these errors were encountered: