Skip to content

Commit

Permalink
Fix stupid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
torkleyy committed Apr 3, 2018
1 parent b072512 commit 0cc76c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions benches/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ const KEYS: &[&str] = &[
];

fn all_keys() -> Vec<String> {
KEYS.iter()
.flat_map(|&key| (0..50).map(move |nr| format!("{}{}", key, nr)))
.collect()
let mut v: Vec<_> = KEYS.iter()
.flat_map(|&key| (0..3).map(move |nr| format!("{}{}", key, nr)))
.collect();
v.push("hello".to_owned());

v
}

#[bench]
Expand Down
2 changes: 1 addition & 1 deletion src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ unsafe fn search8(key: u64, elements: &[u64]) -> usize {

fn search(key: u64, elements: &[u64]) -> Option<usize> {
let len = elements.len();
let index = len << 3;
let index = len >> 3;

let guess = unsafe {
match index {
Expand Down

0 comments on commit 0cc76c1

Please sign in to comment.