From d26f0ea01028c99e2f5aafa8177ee544320af35a Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Wed, 29 May 2024 13:36:58 +0200 Subject: [PATCH] Fix basic tests --- .../src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt index bcf13b5..da00864 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt @@ -76,7 +76,6 @@ sealed class Tournament ( fun recomputeDUDD(round: Int, gameID: ID) { // Instantiate solver with game history - val history = historyBefore(round) val solver = pairing.solver(this, round, pairables.values.toList()) // Recomputes DUDD and hd @@ -92,8 +91,8 @@ sealed class Tournament ( * Recompute DUDD for the specified round */ fun recomputeDUDD(round: Int) { + if (pairables.isEmpty() || games(1).isEmpty()) return; // Instantiate solver with game history - val history = historyBefore(round) val solver = pairing.solver(this, round, pairables.values.toList()) for (game in games(round).values) { val white = solver.pairables.find { p-> p.id == game.white }!!