Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Do not always replace in transposition table
Browse files Browse the repository at this point in the history
  • Loading branch information
mhib committed Oct 6, 2021
1 parent 9ab85e1 commit a37962c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion transposition/transposition_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ func (t *TranspositionTable) Get(key uint64) (ok bool, value int16, eval int16,

func (t *TranspositionTable) Set(key uint64, value int16, eval int16, depth int, bestMove backend.Move, flag int, pvNode bool) {
var element = &t.Entries[key&t.Mask]
element.key = uint32(key >> 32)
adjustedKey := uint32(key >> 32)
if flag != TransExact && element.key == adjustedKey && (int(element.depth)+NoneDepth)/2 >= depth && element.flagPv.getFlag() != TransNone {
return
}
element.key = adjustedKey
element.value = value
element.eval = eval
element.flagPv = newFlagPv(flag, pvNode)
Expand Down

0 comments on commit a37962c

Please sign in to comment.