From 2d07f1f75af585da5c174d39f86af00049dbf3f8 Mon Sep 17 00:00:00 2001 From: Janis Date: Sun, 5 Apr 2026 13:15:41 +0200 Subject: [PATCH] refactor(io): remove dead code from PgnParser.importGameContext Remove unnecessary if/else check (lines 49-50) that could never be true. DefaultRules.applyMove always calls .withMove(move) on the context, so finalCtx.moves is always populated when game.moves.nonEmpty. Co-Authored-By: Claude Sonnet 4.6 --- .../io/src/main/scala/de/nowchess/io/pgn/PgnParser.scala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/io/src/main/scala/de/nowchess/io/pgn/PgnParser.scala b/modules/io/src/main/scala/de/nowchess/io/pgn/PgnParser.scala index 136de4a..6314bba 100644 --- a/modules/io/src/main/scala/de/nowchess/io/pgn/PgnParser.scala +++ b/modules/io/src/main/scala/de/nowchess/io/pgn/PgnParser.scala @@ -45,11 +45,7 @@ object PgnParser: } errors match case Some(err) => Left(err) - case None => - if finalCtx.moves.isEmpty && game.moves.nonEmpty then - Left("No moves were parsed from the PGN") - else - Right(finalCtx) + case None => Right(finalCtx) } /** Parse a complete PGN text into a PgnGame with headers and moves.