mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
TranspositionTable: early skip on an empty TT entry
Instead of going for the whole 4 cycle loop early skip if TT entry is empty. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
7c93b171cb
commit
392360e73b
1 changed files with 6 additions and 0 deletions
|
@ -108,6 +108,12 @@ void TranspositionTable::store(const Position &pos, Value v, Depth d,
|
||||||
tte = replace = entries + int(pos.get_key() & (size - 1)) * 4;
|
tte = replace = entries + int(pos.get_key() & (size - 1)) * 4;
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
if (!(tte+i)->key()) // still empty
|
||||||
|
{
|
||||||
|
*(tte+i) = TTEntry(pos.get_key(), v, type, d, m, generation);
|
||||||
|
writes++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((tte+i)->key() == pos.get_key())
|
if ((tte+i)->key() == pos.get_key())
|
||||||
{
|
{
|
||||||
if (m == MOVE_NONE)
|
if (m == MOVE_NONE)
|
||||||
|
|
Loading…
Add table
Reference in a new issue