Skip to content

Commit

Permalink
Update for pattern changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Aug 2, 2014
1 parent c9ca9b1 commit f79814a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions phf/src/lib.rs
Expand Up @@ -107,8 +107,9 @@ impl<K, V> PhfMap<K, V> {
-> Option<&(K, V)> {
let (g, f1, f2) = shared::hash(key, self.k1, self.k2);
let (d1, d2) = self.disps[g % self.disps.len()];
let entry @ &(ref s, _) = &self.entries[shared::displace(f1, f2, d1, d2) %
self.entries.len()];
let entry = &self.entries[shared::displace(f1, f2, d1, d2) %
self.entries.len()];
let &(ref s, _) = entry;
if check(s) {
Some(entry)
} else {
Expand Down Expand Up @@ -451,7 +452,8 @@ impl<K, V> PhfOrderedMap<K, V> {
let (g, f1, f2) = shared::hash(key, self.k1, self.k2);
let (d1, d2) = self.disps[g % self.disps.len()];
let idx = self.idxs[shared::displace(f1, f2, d1, d2) % self.idxs.len()];
let entry @ &(ref s, _) = &self.entries[idx];
let entry = &self.entries[idx];
let &(ref s, _) = entry;

if check(s) {
Some(entry)
Expand Down

0 comments on commit f79814a

Please sign in to comment.