From: Marco Costalba Date: Sun, 23 Mar 2014 09:03:11 +0000 (+0100) Subject: Simplify TT replace strategy X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=865b71309c4dd5c6c67c9c9422df5790cbb22440;hp=e7362dae781ce9c1e3175427f2f00f6abbc0bb06 Simplify TT replace strategy Tested for no-regression with SPRT[-3, 1] at STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 32046 W: 6020 L: 5918 D: 20108 No functional change. --- diff --git a/src/tt.cpp b/src/tt.cpp index 41fc33ff..d887844c 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -94,7 +94,6 @@ const TTEntry* TranspositionTable::probe(const Key key) const { void TranspositionTable::store(const Key key, Value v, Bound b, Depth d, Move m, Value statV) { - int c1, c2, c3; TTEntry *tte, *replace; uint32_t key32 = key >> 32; // Use the high 32 bits as key inside the cluster @@ -112,11 +111,9 @@ void TranspositionTable::store(const Key key, Value v, Bound b, Depth d, Move m, } // Implement replace strategy - c1 = (replace->generation8 == generation ? 2 : 0); - c2 = (tte->generation8 == generation || tte->bound() == BOUND_EXACT ? -2 : 0); - c3 = (tte->depth16 < replace->depth16 ? 1 : 0); - - if (c1 + c2 + c3 > 0) + if ( (replace->generation8 == generation) * 2 + - (tte->generation8 == generation || tte->bound() == BOUND_EXACT) * 2 + + (tte->depth16 < replace->depth16) > 0) replace = tte; }