Skip to content

Commit 48f38f3

Browse files
committed
Retire mirror()
Inline the only caller site. No functional change.
1 parent 281472e commit 48f38f3

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/endgame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace {
7272
assert(pos.count<PAWN>(strongSide) == 1);
7373

7474
if (file_of(pos.list<PAWN>(strongSide)[0]) >= FILE_E)
75-
sq = mirror(sq);
75+
sq = Square(sq ^ 7); // Mirror SQ_H1 -> SQ_A1
7676

7777
if (strongSide == BLACK)
7878
sq = ~sq;

src/types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ inline Rank rank_of(Square s) {
371371
return Rank(s >> 3);
372372
}
373373

374-
inline Square mirror(Square s) {
375-
return Square(s ^ 7); // Horizontal flip SQ_A1 -> SQ_H1
376-
}
377-
378374
inline Square relative_square(Color c, Square s) {
379375
return Square(s ^ (c * 56));
380376
}

0 commit comments

Comments
 (0)