minor rework in tt | bench 3415609

This commit is contained in:
rektdie committed 2025-06-06 09:58:24 +02:00
1 parent dec219e4d7
commit 4564d10bcf
3 files changed
+18 -11

No files matched your search

+5 -5
View File
@@ -1,16 +1,16 @@
#include "tt.h"
SearchResults TTable::ReadEntry(U64 &hashKey, int depth, int alpha, int beta) {
TTEntry TTable::ReadEntry(U64 &hashKey, int depth, int alpha, int beta) {
TTEntry *current = &table[hashKey % table.size()];
if (current->hashKey == hashKey) {
if (current->depth >= depth) {
if (current->nodeType == PV){
return {current->score, current->bestMove};
return *current;
} else if (current->nodeType == AllNode && current->score <= alpha) {
return current->score;
return *current;
} else if (current->nodeType == CutNode && current->score >= beta) {
return current->score;
return *current;
}
}
}
@@ -27,4 +27,4 @@ void TTable::WriteEntry(U64 &hashKey, int depth, int score, int nodeType, Move b
current->score = score;
current->depth = depth;
current->bestMove = bestMove;
}
}