ooh at 99% cap

This commit is contained in:
2026-05-19 18:02:24 -07:00
parent 418e422f12
commit 5b277601ea
+2 -1
View File
@@ -410,7 +410,8 @@ where
let mut state_moves = std::collections::HashMap::with_capacity(HUGE_CAP); let mut state_moves = std::collections::HashMap::with_capacity(HUGE_CAP);
let mut state = self.clone(); let mut state = self.clone();
while !state.is_win() { while !state.is_win() {
if HUGE_CAP <= state_moves.len() { // don't look for empty hash map buckets when the hash map is 99% full!
if HUGE_CAP * 127 <= state_moves.len() * 128 {
return Err(Oom); return Err(Oom);
} }