Remove unused threatenedPieces

threatenedPieces is no longer used since #6023

Also can_move_king_or_pawn() can be const.
Also remove a couple of redundant declarations.

closes https://github.com/official-stockfish/Stockfish/pull/6101

No functional change
This commit is contained in:
mstembera
2025-05-26 18:26:31 -07:00
committed by Joost VandeVondele
parent dc85c5a4c9
commit d27298d7dc
4 changed files with 4 additions and 12 deletions

View File

@@ -128,18 +128,13 @@ void MovePicker::score() {
Color us = pos.side_to_move();
[[maybe_unused]] Bitboard threatenedPieces, threatByLesser[QUEEN + 1];
[[maybe_unused]] Bitboard threatByLesser[QUEEN + 1];
if constexpr (Type == QUIETS)
{
threatByLesser[KNIGHT] = threatByLesser[BISHOP] = pos.attacks_by<PAWN>(~us);
threatByLesser[ROOK] =
pos.attacks_by<KNIGHT>(~us) | pos.attacks_by<BISHOP>(~us) | threatByLesser[KNIGHT];
threatByLesser[QUEEN] = pos.attacks_by<ROOK>(~us) | threatByLesser[ROOK];
// Pieces threatened by pieces of lesser material value
threatenedPieces = (pos.pieces(us, QUEEN) & threatByLesser[QUEEN])
| (pos.pieces(us, ROOK) & threatByLesser[ROOK])
| (pos.pieces(us, KNIGHT, BISHOP) & threatByLesser[KNIGHT]);
}
for (auto& m : *this)
@@ -316,11 +311,11 @@ top:
void MovePicker::skip_quiet_moves() { skipQuiets = true; }
// this function must be called after all quiet moves and captures have been generated
bool MovePicker::can_move_king_or_pawn() {
bool MovePicker::can_move_king_or_pawn() const {
// SEE negative captures shouldn't be returned in GOOD_CAPTURE stage
assert(stage > GOOD_CAPTURE && stage != EVASION_INIT);
for (ExtMove* m = moves; m < endCur; ++m)
for (const ExtMove* m = moves; m < endCur; ++m)
{
PieceType movedPieceType = type_of(pos.moved_piece(*m));
if ((movedPieceType == PAWN || movedPieceType == KING) && pos.legal(*m))

View File

@@ -50,7 +50,7 @@ class MovePicker {
MovePicker(const Position&, Move, int, const CapturePieceToHistory*);
Move next_move();
void skip_quiet_moves();
bool can_move_king_or_pawn();
bool can_move_king_or_pawn() const;
private:
template<typename Pred>

View File

@@ -81,7 +81,6 @@ constexpr std::size_t MaxSimdWidth = 32;
// Type of input feature after conversion
using TransformedFeatureType = std::uint8_t;
using IndexType = std::uint32_t;
// Round n up to be a multiple of base
template<typename IntType>

View File

@@ -28,8 +28,6 @@
namespace Stockfish {
enum Color : int8_t;
TimePoint TimeManagement::optimum() const { return optimumTime; }
TimePoint TimeManagement::maximum() const { return maximumTime; }