X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.h;h=e1bef323af5092474f07a96db48ff2d8fb8b4e9f;hp=24045ed0f40c879056dbbca5e6e7cfa776e5641e;hb=2198cd0524574f0d9df8c0ec9aaf14ad8c94402b;hpb=b53239d6410cfc87bf454370671390b04879ef05;ds=sidebyside diff --git a/src/tt.h b/src/tt.h index 24045ed0..e1bef323 100644 --- a/src/tt.h +++ b/src/tt.h @@ -104,9 +104,9 @@ public: void resize(size_t mbSize); void clear(); - // The lowest order bits of the key are used to get the index of the cluster + // The 32 lowest order bits of the key are used to get the index of the cluster TTEntry* first_entry(const Key key) const { - return &table[(size_t)key & (clusterCount - 1)].entry[0]; + return &table[(uint32_t(key) * uint64_t(clusterCount)) >> 32].entry[0]; } private: