X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fpawns.cpp;h=c314c4ae6634bad6fc97bd9831dd89a6f2c32ee7;hb=6096ca7a95f2f3bc1049b4fe240b21b7fbc389f9;hp=0ab1c2622f14372b39baf9f82d99e744a0a9f97a;hpb=7b721b3663920a2b74039ad6588ba4ed638c368b;p=stockfish diff --git a/src/pawns.cpp b/src/pawns.cpp index 0ab1c262..c314c4ae 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -320,27 +320,3 @@ int PawnInfoTable::evaluate_pawn_storm(Square s, Rank r, File f, Bitboard theirP } return bonus; } - - -/// PawnInfo::updateShelter calculates and caches king shelter. It is called -/// only when king square changes, about 20% of total king_shelter() calls. -Score PawnInfo::updateShelter(const Position& pos, Color c, Square ksq) { - - Bitboard pawns; - unsigned r, k, shelter = 0; - - if (relative_rank(c, ksq) <= RANK_4) - { - pawns = pos.pieces(PAWN, c) & this_and_neighboring_files_bb(ksq); - r = ksq & (7 << 3); - k = (c ? -8 : 8); - for (int i = 1; i < 4; i++) - { - r += k; - shelter += BitCount8Bit[(pawns >> r) & 0xFF] * (128 >> i); - } - } - kingSquares[c] = ksq; - kingShelters[c] = make_score(shelter, 0); - return kingShelters[c]; -}