Skip to content

Commit

Permalink
refactor: Use std::ranges::fill to clear killers
Browse files Browse the repository at this point in the history
BENCH: 27480710
  • Loading branch information
IbaiBuR committed Jul 10, 2024
1 parent 74db0ef commit d67cd4f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/search/search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ struct search_data {
}

void clear_killers() {
std::ranges::for_each(killer_moves.begin(), killer_moves.end(),
[](killers& current_killers) {
current_killers[0] = current_killers[1] = moves::move::none();
});
for (auto& killer : killer_moves) {
std::ranges::fill(killer.begin(), killer.end(), moves::move::none());
}
}

void update_killers(const moves::move move, const int ply) {
Expand Down

0 comments on commit d67cd4f

Please sign in to comment.