Skip to content

Commit 9fa4424

Browse files
committed
Hash the length of the RingBuf before hashing elements
1 parent 6361577 commit 9fa4424

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcollections/ringbuf.rs

+1
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ impl<A: PartialOrd> PartialOrd for RingBuf<A> {
460460

461461
impl<S: Writer, A: Hash<S>> Hash<S> for RingBuf<A> {
462462
fn hash(&self, state: &mut S) {
463+
self.len().hash(state);
463464
for elt in self.iter() {
464465
elt.hash(state);
465466
}

0 commit comments

Comments
 (0)