rewrote IsThreefold | bench 1154407
This commit is contained in:
1 parent
6453ffa5bd
commit
09ab31974b
2 files changed
+7
-7
No files matched your search
+6
-6
@@ -84,14 +84,14 @@ void ListScores(Board &board, int ply) {
|
||||
}
|
||||
|
||||
static bool IsThreefold(Board &board) {
|
||||
int count = 0;
|
||||
|
||||
for (int i = positionIndex - 1; i >= 0; i--) {
|
||||
if (positionHistory[i] == board.hashKey) count++;
|
||||
|
||||
if (count >= 3) return true;
|
||||
for (int i = 0; i < positionIndex; i++) {
|
||||
if (positionHistory[i] == board.hashKey) {
|
||||
// repetition found
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// no repetition
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user