Skip to content

Commit

Permalink
use map for potentially cpu intensive callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 19, 2024
1 parent 7d43c09 commit 3568d7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/api/src/main/GameApiV2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class GameApiV2(
(game, initialFen, analysis) <- enrich(config.flags)(game)
formatted <- config.format match
case Format.JSON =>
toJson(game, initialFen, analysis, config, realPlayers = realPlayers).dmap(Json.stringify)
toJson(game, initialFen, analysis, config, realPlayers = realPlayers).map(Json.stringify)
case Format.PGN =>
PgnStr.raw(
pgnDump(
Expand All @@ -61,7 +61,7 @@ final class GameApiV2(
analysis,
config.flags,
realPlayers = realPlayers
).dmap(annotator.toPgnString)
).map(annotator.toPgnString)
)
yield formatted

Expand Down

0 comments on commit 3568d7d

Please sign in to comment.