From 09e9686dad35c5c1a34b16b67944203cf9164bd5 Mon Sep 17 00:00:00 2001 From: FreshGuy32 Date: Thu, 16 May 2024 12:36:55 +0000 Subject: [PATCH] refactor(#23): move variable closer to where it is needed to fix style issue --- .../backend/service/impl/TournamentServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/at/ac/tuwien/sepr/groupphase/backend/service/impl/TournamentServiceImpl.java b/backend/src/main/java/at/ac/tuwien/sepr/groupphase/backend/service/impl/TournamentServiceImpl.java index b597e68..5c44db2 100644 --- a/backend/src/main/java/at/ac/tuwien/sepr/groupphase/backend/service/impl/TournamentServiceImpl.java +++ b/backend/src/main/java/at/ac/tuwien/sepr/groupphase/backend/service/impl/TournamentServiceImpl.java @@ -108,8 +108,6 @@ public class TournamentServiceImpl implements TournamentService { for (int i = 0; i < teams.size(); i++) { var team = teams.get(i); - Team opponentLeft = teams.get(Math.floorMod(i - 1, teams.size())); - var match = new QualificationMatch(); qualificationRepository.saveAndFlush(match); matches.add(match); @@ -117,6 +115,8 @@ public class TournamentServiceImpl implements TournamentService { var teamParticipation = new QualificationParticipation(); teamParticipation.setTeam(team); teamParticipation.setQualificationMatch(match); + + Team opponentLeft = teams.get(Math.floorMod(i - 1, teams.size())); var opponentParticipation = new QualificationParticipation(); opponentParticipation.setTeam(opponentLeft); opponentParticipation.setQualificationMatch(match);