fix(TournamentService): move bracketSize calculation to avoid redundancy in knockout pairing logic
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 55s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 55s
This commit is contained in:
@@ -603,6 +603,7 @@ class TournamentService {
|
||||
}
|
||||
|
||||
uniqueEntrants.sort(compareKnockoutEntrants);
|
||||
const bracketSize = nextPowerOfTwo(uniqueEntrants.length);
|
||||
|
||||
// Standardsetzung für zwei Gruppen mit je zwei Qualifikanten:
|
||||
// A1 gegen B2 und B1 gegen A2. Die reine Leistungsreihenfolge
|
||||
@@ -653,7 +654,6 @@ class TournamentService {
|
||||
|
||||
// Paare: Bester gegen Schlechtesten, Zweiter gegen Vorletzten, etc.
|
||||
// Reverse die zweite Hälfte, um das gewünschte Pairing zu erreichen
|
||||
const bracketSize = nextPowerOfTwo(uniqueEntrants.length);
|
||||
const byes = bracketSize - uniqueEntrants.length;
|
||||
const playersNeeded = bracketSize - byes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user