X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftt.cpp;h=653d081f8f0eb01859408043467a4e0486241f2f;hb=dace61600a12f3f1ad1abcb2625f4c497e8f15ba;hp=50e8a3bfac4bad1bcf72ee61d79664d2db36fbe8;hpb=fda0161e3a5295a759f04a0e302567a773f82595;p=stockfish diff --git a/src/tt.cpp b/src/tt.cpp index 50e8a3bf..653d081f 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -85,7 +85,7 @@ void TranspositionTable::clear() { std::vector threads; - for (size_t idx = 0; idx < Options["Threads"]; idx++) + for (size_t idx = 0; idx < Options["Threads"]; ++idx) { threads.emplace_back([this, idx]() { @@ -148,12 +148,9 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const { int TranspositionTable::hashfull() const { int cnt = 0; - for (int i = 0; i < 1000 / ClusterSize; i++) - { - const TTEntry* tte = &table[i].entry[0]; - for (int j = 0; j < ClusterSize; j++) - if ((tte[j].genBound8 & 0xFC) == generation8) - cnt++; - } - return cnt; + for (int i = 0; i < 1000 / ClusterSize; ++i) + for (int j = 0; j < ClusterSize; ++j) + cnt += (table[i].entry[j].genBound8 & 0xFC) == generation8; + + return cnt * 1000 / (ClusterSize * (1000 / ClusterSize)); }