From dcbc8a7e7584511fe31db94c1b011e9ab541ca21 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 7 Jan 2011 11:10:20 +0100 Subject: [PATCH] Use a 32 bit bitwise 'and' in SimpleHash lookup A bit faster on 32 bits machines, more similar to TranspositionTable::first_entry() and same result. No functional change. Signed-off-by: Marco Costalba --- src/tt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tt.h b/src/tt.h index f2928fb9..d7f57cc0 100644 --- 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; -- 2.39.2