diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt index cf59bab..d5324d4 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/SwissSolver.kt @@ -17,8 +17,9 @@ class SwissSolver(round: Int, // In a Swiss tournament the main criterion is the number of wins and already computed override val scores by lazy { - historyHelper.wins.mapValues { - Pair(0.0, it.value) } + pairablesMap.mapValues { + Pair(0.0, historyHelper.wins[it.value.id] ?: 0.0) + } } override val scoresX: Map get() = scores.mapValues { it.value.second }