Use existing function for removing and placing a piece.

Passed non-regression STC:
```
LLR: 3.33 (-2.94,2.94) <-1.75,0.25>
Total: 359712 W: 93077 L: 93175 D: 173460
Ptnml(0-2): 1088, 39816, 98144, 39722, 1086
```
https://tests.stockfishchess.org/tests/view/69af5e9a6b61ccc788710e31

closes https://github.com/official-stockfish/Stockfish/pull/6667

No functional change
This commit is contained in:
Pieter te Brake
2026-03-18 20:49:06 +01:00
committed by Disservin
parent e38f5b2f53
commit e093339c2f
+1 -2
View File
@@ -1124,9 +1124,8 @@ void Position::undo_move(Move m) {
assert(type_of(pc) == m.promotion_type());
assert(type_of(pc) >= KNIGHT && type_of(pc) <= QUEEN);
remove_piece(to);
pc = make_piece(us, PAWN);
put_piece(pc, to);
swap_piece(to, pc);
}
if (m.type_of() == CASTLING)