From 8815d1ef02038e5f60b974b2d24c380bbd6ba4d8 Mon Sep 17 00:00:00 2001 From: mstembera <5421953+mstembera@users.noreply.github.com> Date: Tue, 30 Dec 2025 20:45:32 -0800 Subject: [PATCH] Minor cleanup in full_threats.cpp closes https://github.com/official-stockfish/Stockfish/pull/6509 No functional change --- src/nnue/features/full_threats.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nnue/features/full_threats.cpp b/src/nnue/features/full_threats.cpp index 63b7f8e13..9006d851b 100644 --- a/src/nnue/features/full_threats.cpp +++ b/src/nnue/features/full_threats.cpp @@ -68,11 +68,11 @@ constexpr auto make_piece_indices_type() { std::array, SQUARE_NB> out{}; - for (int from = 0; from < SQUARE_NB; ++from) + for (Square from = SQ_A1; from <= SQ_H8; ++from) { - Bitboard attacks = PseudoAttacks[PT][Square(from)]; + Bitboard attacks = PseudoAttacks[PT][from]; - for (int to = 0; to < SQUARE_NB; ++to) + for (Square to = SQ_A1; to <= SQ_H8; ++to) { out[from][to] = constexpr_popcount(((1ULL << to) - 1) & attacks); } @@ -89,11 +89,11 @@ constexpr auto make_piece_indices_piece() { constexpr Color C = color_of(P); - for (int from = 0; from < SQUARE_NB; ++from) + for (Square from = SQ_A1; from <= SQ_H8; ++from) { Bitboard attacks = PseudoAttacks[C][from]; - for (int to = 0; to < SQUARE_NB; ++to) + for (Square to = SQ_A1; to <= SQ_H8; ++to) { out[from][to] = constexpr_popcount(((1ULL << to) - 1) & attacks); } @@ -323,11 +323,11 @@ void FullThreats::append_changed_indices(Color perspective, { if (first) { - fusedData->dp2removedOriginBoard |= square_bb(to); + fusedData->dp2removedOriginBoard |= to; continue; } } - else if (fusedData->dp2removedOriginBoard & square_bb(to)) + else if (fusedData->dp2removedOriginBoard & to) continue; } @@ -337,11 +337,11 @@ void FullThreats::append_changed_indices(Color perspective, { if (first) { - fusedData->dp2removedTargetBoard |= square_bb(from); + fusedData->dp2removedTargetBoard |= from; continue; } } - else if (fusedData->dp2removedTargetBoard & square_bb(from)) + else if (fusedData->dp2removedTargetBoard & from) continue; } }