From 5b277601eac2d543086356d4d2d7f0ae0e24ca5c Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Tue, 19 May 2026 18:02:24 -0700 Subject: [PATCH] ooh at 99% cap --- card_game/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/card_game/src/lib.rs b/card_game/src/lib.rs index 40193da..6d6727a 100644 --- a/card_game/src/lib.rs +++ b/card_game/src/lib.rs @@ -410,7 +410,8 @@ where let mut state_moves = std::collections::HashMap::with_capacity(HUGE_CAP); let mut state = self.clone(); 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); }