minor rework in tt | bench 3415609
This commit is contained in:
1 parent
dec219e4d7
commit
4564d10bcf
3 files changed
+18
-11
No files matched your search
+5
-5
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user