]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Lookup square distance instead of calculate on the fly
[stockfish] / src / pawns.cpp
index c099153a2ca5d7e1038d15a6ca01e934fcdfa859..b3c65a0f166268200fb918d4a751f2563f7de378 100644 (file)
@@ -79,8 +79,6 @@ namespace {
 
 PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) const {
 
-  assert(pos.is_ok());
-
   Key key = pos.get_pawn_key();
   PawnInfo* pi = probe(key);
 
@@ -230,7 +228,7 @@ Score PawnInfo::updateShelter(const Position& pos, Square ksq) {
       for (int i = 0; i < 3; i++)
       {
           r += Shift;
-          shelter += BitCount8Bit[(pawns >> r) & 0xFF] * (64 >> i);
+          shelter += BitCount8Bit[(pawns >> r) & 0xFF] << (6 - i);
       }
   }
   kingSquares[Us] = ksq;