Unusual conflict, no apparent commits from another machine. Resolved formatting. Using HEAD.

This commit is contained in:
Christian Lincoln 2026-09-28 21:35:58 +01:00
commit d45e9bd270

View file

@ -263,34 +263,12 @@ impl<E: TableEntry> DisplacementSet<E> {
}
}
}
pub fn get<K>(&mut self, index: K) -> Option<&E>
where
E: Equivalent<K>,
K: Hashes,
{
if self.map.len() == 0 {
return None;
}
let location = index.hashed() as usize % self.map.len();
let home = &self.map[location];
if home.entry.matches(&index) {
Some(&home.entry)
} else {
for i in 1..home.displacement as usize {
let neighbour = &self.map[(location + i) % self.map.len()];
if neighbour.entry.matches(&index) {
return Some(&neighbour.entry);
}
}
None
}
}
pub fn new() -> DisplacementSet<E> {
DisplacementSet {
map: Vec::new(),
map_count: 0,
map_bounds: (0..0).into(),
}
}
pub fn new() -> DisplacementSet<E> {
DisplacementSet {
map: Vec::new(),
map_count: 0,
map_bounds: (0..0).into(),
}
}