aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/bloom.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2015-01-15 13:26:44 -0500
committerGlenn Watson <gw@intuitionlibrary.com>2015-01-28 10:16:49 +1000
commit95fc29fa0db21959df99d81cdbb9561226321d2f (patch)
treea48e171165ec155062ef13c550b2c0f72d127425 /components/util/bloom.rs
parentff8cbff81016c157373c1675f3eee69dd70ae544 (diff)
downloadservo-95fc29fa0db21959df99d81cdbb9561226321d2f.tar.gz
servo-95fc29fa0db21959df99d81cdbb9561226321d2f.zip
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
Diffstat (limited to 'components/util/bloom.rs')
-rw-r--r--components/util/bloom.rs12
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;
})
}