mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-06 10:53:50 +08:00
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:
committed by
Joost VandeVondele
parent
dc85c5a4c9
commit
d27298d7dc
@@ -128,18 +128,13 @@ void MovePicker::score() {
|
|||||||
|
|
||||||
Color us = pos.side_to_move();
|
Color us = pos.side_to_move();
|
||||||
|
|
||||||
[[maybe_unused]] Bitboard threatenedPieces, threatByLesser[QUEEN + 1];
|
[[maybe_unused]] Bitboard threatByLesser[QUEEN + 1];
|
||||||
if constexpr (Type == QUIETS)
|
if constexpr (Type == QUIETS)
|
||||||
{
|
{
|
||||||
threatByLesser[KNIGHT] = threatByLesser[BISHOP] = pos.attacks_by<PAWN>(~us);
|
threatByLesser[KNIGHT] = threatByLesser[BISHOP] = pos.attacks_by<PAWN>(~us);
|
||||||
threatByLesser[ROOK] =
|
threatByLesser[ROOK] =
|
||||||
pos.attacks_by<KNIGHT>(~us) | pos.attacks_by<BISHOP>(~us) | threatByLesser[KNIGHT];
|
pos.attacks_by<KNIGHT>(~us) | pos.attacks_by<BISHOP>(~us) | threatByLesser[KNIGHT];
|
||||||
threatByLesser[QUEEN] = pos.attacks_by<ROOK>(~us) | threatByLesser[ROOK];
|
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)
|
for (auto& m : *this)
|
||||||
@@ -316,11 +311,11 @@ top:
|
|||||||
void MovePicker::skip_quiet_moves() { skipQuiets = true; }
|
void MovePicker::skip_quiet_moves() { skipQuiets = true; }
|
||||||
|
|
||||||
// this function must be called after all quiet moves and captures have been generated
|
// 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
|
// SEE negative captures shouldn't be returned in GOOD_CAPTURE stage
|
||||||
assert(stage > GOOD_CAPTURE && stage != EVASION_INIT);
|
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));
|
PieceType movedPieceType = type_of(pos.moved_piece(*m));
|
||||||
if ((movedPieceType == PAWN || movedPieceType == KING) && pos.legal(*m))
|
if ((movedPieceType == PAWN || movedPieceType == KING) && pos.legal(*m))
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class MovePicker {
|
|||||||
MovePicker(const Position&, Move, int, const CapturePieceToHistory*);
|
MovePicker(const Position&, Move, int, const CapturePieceToHistory*);
|
||||||
Move next_move();
|
Move next_move();
|
||||||
void skip_quiet_moves();
|
void skip_quiet_moves();
|
||||||
bool can_move_king_or_pawn();
|
bool can_move_king_or_pawn() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename Pred>
|
template<typename Pred>
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ constexpr std::size_t MaxSimdWidth = 32;
|
|||||||
|
|
||||||
// Type of input feature after conversion
|
// Type of input feature after conversion
|
||||||
using TransformedFeatureType = std::uint8_t;
|
using TransformedFeatureType = std::uint8_t;
|
||||||
using IndexType = std::uint32_t;
|
|
||||||
|
|
||||||
// Round n up to be a multiple of base
|
// Round n up to be a multiple of base
|
||||||
template<typename IntType>
|
template<typename IntType>
|
||||||
|
|||||||
@@ -28,8 +28,6 @@
|
|||||||
|
|
||||||
namespace Stockfish {
|
namespace Stockfish {
|
||||||
|
|
||||||
enum Color : int8_t;
|
|
||||||
|
|
||||||
TimePoint TimeManagement::optimum() const { return optimumTime; }
|
TimePoint TimeManagement::optimum() const { return optimumTime; }
|
||||||
TimePoint TimeManagement::maximum() const { return maximumTime; }
|
TimePoint TimeManagement::maximum() const { return maximumTime; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user