Skip to content

Commit

Permalink
fix unsoundness of RootMoveList
Browse files Browse the repository at this point in the history
  • Loading branch information
safe4u committed Jul 7, 2024
1 parent 6370f65 commit 5d47fd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pleco_engine/src/root_moves/root_moves_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ impl RootMoveList {

#[inline]
pub fn insert_score_depth(&mut self, index: usize, score: i32, depth: i16) {
debug_assert!(index < self.len());
unsafe {
let rm: &mut RootMove = self.get_unchecked_mut(index);
rm.score = score;
Expand All @@ -102,6 +103,7 @@ impl RootMoveList {

#[inline]
pub fn insert_score(&mut self, index: usize, score: i32) {
debug_assert!(index < self.len());
unsafe {
let rm: &mut RootMove = self.get_unchecked_mut(index);
rm.score = score;
Expand Down

0 comments on commit 5d47fd1

Please sign in to comment.