From a4cbde9713d6a47a2268a56642b1cbc0398bf982 Mon Sep 17 00:00:00 2001 From: jackjohn7 <70782491+jackjohn7@users.noreply.github.com> Date: Wed, 15 Apr 2026 02:47:46 -0500 Subject: [PATCH] use unstable sort, small optimization --- src/ai.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ai.rs b/src/ai.rs index 401b6e8..b770e54 100644 --- a/src/ai.rs +++ b/src/ai.rs @@ -93,7 +93,7 @@ pub fn alphabeta(mut game: Game, depth: u8, mut alpha: i8, mut beta: i8) -> (Boa // since we're considering the "best" moves first. // We do this by mapping moves to ranked moves and then sorting. let mut moves = explode_board(moves).map(MoveRank::from).collect::>(); - moves.sort(); + moves.sort_unstable(); let moves = moves .into_iter() .map(MoveRank::into_inner)