Skip to content

Commit

Permalink
map_or
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiaha committed Dec 27, 2024
1 parent 56f6215 commit 5999962
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl<'a> Search<'a> {

let extension = tt_entry
.filter(|&entry| Self::can_singular_extend(entry, m, depth, excluded_move))
.map(|entry| {
.map_or(0, |entry| {
let target = entry.value() - (2 * depth as Value);
self.excluded_moves[ply] = Some(m);
let extension =
Expand All @@ -295,8 +295,7 @@ impl<'a> Search<'a> {
};
self.excluded_moves[ply] = None;
extension
})
.unwrap_or(0);
});

///////////////////////////////////////////////////////////////////
// Make move and deepen search via principal variation search.
Expand Down

0 comments on commit 5999962

Please sign in to comment.