mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Fix DTZTable key check
We currently check onnly first key, while we shoudl check both, as confirmed by author on talkchess: http://www.talkchess.com/forum/viewtopic.php?t=59947&start=30 This bug fix do not change functionality, we simply find earlier the DTZ entry instead of reload it.
This commit is contained in:
parent
8baa476390
commit
8d2eb34944
1 changed files with 3 additions and 3 deletions
|
@ -1176,14 +1176,14 @@ int probe_dtz_table(const Position& pos, WDLScore wdl, int *success)
|
||||||
|
|
||||||
// Enforce "Most Recently Used" (MRU) order for DTZ list
|
// Enforce "Most Recently Used" (MRU) order for DTZ list
|
||||||
for (auto it = DTZTable.begin(); it != DTZTable.end(); ++it)
|
for (auto it = DTZTable.begin(); it != DTZTable.end(); ++it)
|
||||||
if (it->key == key) {
|
if (it->key == key || it->key2 == key) {
|
||||||
// Move to front without deleting the element
|
// Move to front without deleting the element
|
||||||
DTZTable.splice(DTZTable.begin(), DTZTable, it);
|
DTZTable.splice(DTZTable.begin(), DTZTable, it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If still not found, add a new one
|
// If still not found, add a new one
|
||||||
if (DTZTable.front().key != key) {
|
if (DTZTable.front().key != key && DTZTable.front().key2 != key) {
|
||||||
|
|
||||||
WDLEntry* wdlEntry = WDLHash[key];
|
WDLEntry* wdlEntry = WDLHash[key];
|
||||||
if (!wdlEntry) {
|
if (!wdlEntry) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue