]> git.sesse.net Git - stockfish/commitdiff
Use a 32 bit bitwise 'and' in SimpleHash lookup
authorMarco Costalba <mcostalba@gmail.com>
Fri, 7 Jan 2011 10:10:20 +0000 (11:10 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 7 Jan 2011 10:25:13 +0000 (11:25 +0100)
A bit faster on 32 bits machines, more similar to
TranspositionTable::first_entry() and same result.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/tt.h

index f2928fb9e84b4b754ae9c1ecfb9a1c01b7778a56..d7f57cc098d117be657234a516ca8d3494af62ac 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -60,7 +60,7 @@ public:
 
   ~SimpleHash() { delete [] entries; }
 
-  Entry* find(Key key) const { return entries + unsigned(key & (HashSize - 1)); }
+  Entry* find(Key key) const { return entries + ((uint32_t)key & (HashSize - 1)); }
 
 protected:
   Entry* entries;