Skip to content

Commit

Permalink
Fix scoreboard after a contest end.
Browse files Browse the repository at this point in the history
  • Loading branch information
kunyavskiy committed Apr 18, 2024
1 parent 036339c commit f15ae65
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import org.icpclive.util.getLogger

class ScoreboardService : Service {
private fun setUp(level: OptimismLevel, flow: Flow<ContestStateWithScoreboard>) {
DataBus.setScoreboardDiffs(level, flow.filter { it.isAffectingScoreboard() }.withIndex().map { (index, it) -> it.toScoreboardDiff(snapshot = index == 0) })
DataBus.setLegacyScoreboard(level, flow.filter { it.isAffectingScoreboard() }.map { it.toLegacyScoreboard() })
DataBus.setScoreboardDiffs(level, flow.withIndex().filter { it.index == 0 || it.value.isAffectingScoreboard() }.map { (index, it) -> it.toScoreboardDiff(snapshot = index == 0) })
DataBus.setLegacyScoreboard(level, flow.withIndex().filter { it.index == 0 || it.value.isAffectingScoreboard() }.map { it.value.toLegacyScoreboard() })
}

private fun ContestStateWithScoreboard.isAffectingScoreboard() : Boolean {
Expand Down

0 comments on commit f15ae65

Please sign in to comment.