diff options
Diffstat (limited to 'components/util/bloom.rs')
-rw-r--r-- | components/util/bloom.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/util/bloom.rs b/components/util/bloom.rs index 2bed80e9e13..6fd5d17e775 100644 --- a/components/util/bloom.rs +++ b/components/util/bloom.rs @@ -58,7 +58,7 @@ const KEY_SHIFT: uint = 16; /// positive rate for N == 100 and to quite bad false positive /// rates for larger N. pub struct BloomFilter { - counters: [u8, ..ARRAY_SIZE], + counters: [u8; ARRAY_SIZE], } impl Clone for BloomFilter { @@ -75,7 +75,7 @@ impl BloomFilter { #[inline] pub fn new() -> BloomFilter { BloomFilter { - counters: [0, ..ARRAY_SIZE], + counters: [0; ARRAY_SIZE], } } @@ -101,7 +101,7 @@ impl BloomFilter { #[inline] pub fn clear(&mut self) { - self.counters = [0, ..ARRAY_SIZE] + self.counters = [0; ARRAY_SIZE] } #[inline] @@ -231,7 +231,7 @@ fn create_and_insert_some_stuff() { let false_positives = range(1001u, 2000).filter(|i| bf.might_contain(i)).count(); - assert!(false_positives < 10) // 1%. + assert!(false_positives < 10); // 1%. for i in range(0u, 100) { bf.remove(&i); @@ -256,7 +256,7 @@ fn create_and_insert_some_stuff() { mod bench { extern crate test; - use std::hash::hash; + use std::hash::{hash, SipHasher}; use std::iter; use super::BloomFilter; @@ -331,7 +331,7 @@ mod bench { fn hash_a_uint(b: &mut test::Bencher) { let mut i = 0u; b.iter(|| { - test::black_box(hash(&i)); + test::black_box(hash::<uint, SipHasher>(&i)); i += 1; }) } |