]> git.sesse.net Git - stockfish/blobdiff - src/tt.cpp
Additional tidy up in timeman.cpp
[stockfish] / src / tt.cpp
index 2979c104aac3020c3798996597b182174b03ad4b..19f21de22f21ee12f077538f4a812f46ef40a64c 100644 (file)
@@ -63,12 +63,12 @@ void TranspositionTable::clear() {
 }
 
 
-/// TranspositionTable::probe() looks up the current position in the
-/// transposition table. It returns true and a pointer to the TTEntry if
-/// the position is found. Otherwise, it returns false and a pointer to an empty or
-/// least valuable TTEntry to be replaced later. A TTEntry t1 is considered
-/// to be more valuable than a TTEntry t2 if t1 is from the current search and t2
-/// is from a previous search, or if the depth of t1 is bigger than the depth of t2.
+/// TranspositionTable::probe() looks up the current position in the transposition
+/// table. It returns true and a pointer to the TTEntry if the position is found.
+/// Otherwise, it returns false and a pointer to an empty or least valuable TTEntry
+/// to be replaced later. A TTEntry t1 is considered to be more valuable than a
+/// TTEntry t2 if t1 is from the current search and t2 is from a previous search,
+/// or if the depth of t1 is bigger than the depth of t2.
 
 TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
 
@@ -79,20 +79,18 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
       if (!tte[i].key16 || tte[i].key16 == key16)
       {
           if (tte[i].key16)
-              tte[i].genBound8 = uint8_t(generation | tte[i].bound()); // Refresh
+              tte[i].genBound8 = uint8_t(generation8 | tte[i].bound()); // Refresh
 
-          found = (bool)tte[i].key16;
-          return &tte[i];
+          return found = (bool)tte[i].key16, &tte[i];
       }
 
   // Find an entry to be replaced according to the replacement strategy
   TTEntry* replace = tte;
   for (unsigned i = 1; i < TTClusterSize; ++i)
-      if (  ((  tte[i].genBound8 & 0xFC) == generation || tte[i].bound() == BOUND_EXACT)
-          - ((replace->genBound8 & 0xFC) == generation)
+      if (  ((  tte[i].genBound8 & 0xFC) == generation8 || tte[i].bound() == BOUND_EXACT)
+          - ((replace->genBound8 & 0xFC) == generation8)
           - (tte[i].depth8 < replace->depth8) < 0)
           replace = &tte[i];
 
-  found = false;
-  return replace;
+  return found = false, replace;
 }