X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fpawns.cpp;h=6ec718ff5167c6ca47c5fded3d31161b7072ce29;hb=91cc82aa2566e6b6fa60cf82298250d6e4e2dd46;hp=80dead4fb5378b00068320139ed59861417b11ab;hpb=19b8249ff47ed2109182b2eacfc03ddb3d0a7059;p=stockfish diff --git a/src/pawns.cpp b/src/pawns.cpp index 80dead4f..6ec718ff 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -24,6 +24,7 @@ #include "bitcount.h" #include "pawns.h" #include "position.h" +#include "thread.h" namespace { @@ -202,9 +203,9 @@ namespace { namespace Pawns { -/// init() initializes some tables used by evaluation. Instead of hard-coded -/// tables, when makes sense, we prefer to calculate them with a formula to -/// reduce independent parameters and to allow easier tuning and better insight. +/// Pawns::init() initializes some tables needed by evaluation. Instead of using +/// hard-coded tables, when makes sense, we prefer to calculate them with a formula +/// to reduce independent parameters and to allow easier tuning and better insight. void init() { @@ -220,14 +221,15 @@ void init() } -/// probe() takes a position as input, computes a Entry object, and returns a -/// pointer to it. The result is also stored in a hash table, so we don't have -/// to recompute everything when the same pawn structure occurs again. +/// Pawns::probe() looks up the current position's pawns configuration in +/// the pawns hash table. It returns a pointer to the Entry if the position +/// is found. Otherwise a new Entry is computed and stored there, so we don't +/// have to recompute all when the same pawns configuration occurs again. -Entry* probe(const Position& pos, Table& entries) { +Entry* probe(const Position& pos) { Key key = pos.pawn_key(); - Entry* e = entries[key]; + Entry* e = pos.this_thread()->pawnsTable[key]; if (e->key == key) return e;