Skip to content

Commit

Permalink
Hash the length of the RingBuf before hashing elements
Browse files Browse the repository at this point in the history
  • Loading branch information
nham committed Jul 27, 2014
1 parent 6361577 commit 9fa4424
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libcollections/ringbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ impl<A: PartialOrd> PartialOrd for RingBuf<A> {

impl<S: Writer, A: Hash<S>> Hash<S> for RingBuf<A> {
fn hash(&self, state: &mut S) {
self.len().hash(state);
for elt in self.iter() {
elt.hash(state);
}
Expand Down

5 comments on commit 9fa4424

@bors
Copy link
Contributor

@bors bors commented on 9fa4424 Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at nham@9fa4424

@bors
Copy link
Contributor

@bors bors commented on 9fa4424 Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nham/rust/ringbuf_hash_ord = 9fa4424 into auto

@bors
Copy link
Contributor

@bors bors commented on 9fa4424 Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nham/rust/ringbuf_hash_ord = 9fa4424 merged ok, testing candidate = 7097283

@bors
Copy link
Contributor

@bors bors commented on 9fa4424 Jul 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 7097283

Please sign in to comment.