Skip to content

Commit

Permalink
Bench: 20282767
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Sep 8, 2023
1 parent e0d6e93 commit f572334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,9 @@ INLINE void SqToStr(Square sq, char *str) {
str[1] = '1' + RankOf(sq);
}

INLINE bool IsRepetition(const Position *pos, int count) {
int c = 0;
for (int i = 4; i <= pos->rule50 && i <= pos->histPly; i += 2) {
INLINE bool IsRepetition(const Position *pos) {
for (int i = 4; i <= pos->rule50 && i <= pos->histPly; i += 2)
if (pos->key == history(-i).key)
c++;
if (c == count)
return true;
}
return false;
}
4 changes: 2 additions & 2 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int Quiescence(Thread *thread, Stack *ss, int alpha, const int beta) {
longjmp(thread->jumpBuffer, true);

// Position is drawn
if (IsRepetition(pos, 1 + pvNode) || pos->rule50 >= 100)
if (IsRepetition(pos) || pos->rule50 >= 100)
return DrawScore(pos);

// Probe transposition table
Expand Down Expand Up @@ -218,7 +218,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
}

// Position is drawn
if (IsRepetition(pos, 1 + pvNode) || pos->rule50 >= 100)
if (IsRepetition(pos) || pos->rule50 >= 100)
return DrawScore(pos);

// Max depth reached
Expand Down

0 comments on commit f572334

Please sign in to comment.