Reduce calls to Move.san in castling moves

parent a10a6c93
Pipeline #20148050 passed with stages
in 10 minutes and 52 seconds
......@@ -363,6 +363,11 @@ class Move(namedtuple(
piece, file, rank, destination, promotion = match.groups()
for move in ruleset.moves(position):
if castling and not any(
flag in move.flags for flag in (
MoveFlag.KINGSIDE_CASTLING,
MoveFlag.QUEENSIDE_CASTLING)):
continue
if strict or castling:
move_san = move.san(position, ruleset)
if not strict:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment