1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

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 <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-01-07 11:10:20 +01:00
parent 0ddf84870a
commit dcbc8a7e75

View file

@ -60,7 +60,7 @@ public:
~SimpleHash() { delete [] entries; } ~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: protected:
Entry* entries; Entry* entries;