mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
This commit is contained in:
parent
ff8cbff810
commit
95fc29fa0d
255 changed files with 3550 additions and 3362 deletions
|
@ -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;
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue