Use acquire() and release() for spinlocks
[stockfish] / src / movepick.cpp
index d6a40d70af4c7d2d37305fe1f60dde62d6f51791..b82e68b66a8019160998e7c0880c71ef58bbac2a 100644 (file)
@@ -162,9 +162,9 @@ void MovePicker::score<CAPTURES>() {
 
 template<>
 void MovePicker::score<QUIETS>() {
-  Square prevMoveSq = to_sq((ss-1)->currentMove);
-  Piece prevMovePiece = pos.piece_on(prevMoveSq);
-  const HistoryStats &cmh = counterMovesHistory[prevMovePiece][prevMoveSq];
+
+  Square prevSq = to_sq((ss-1)->currentMove);
+  const HistoryStats& cmh = counterMovesHistory[pos.piece_on(prevSq)][prevSq];
 
   for (auto& m : *this)
       m.value =  history[pos.moved_piece(m)][to_sq(m)]