fix group stage scheduling

online_reg
Raz 10 months ago
parent 51fbc26c12
commit ecf89f6b1d
  1. 8
      PadelClub/Data/MatchScheduler.swift

@ -229,14 +229,10 @@ final class MatchScheduler : ModelObject, Storable {
return teamsAvailable return teamsAvailable
})) }))
if rotationIndex > 0 { if rotationIndex > 0, simultaneousStart == false {
rotationMatches = rotationMatches.sorted(by: { rotationMatches = rotationMatches.sorted(by: {
if counts[$0.groupStageObject!.index] ?? 0 == counts[$1.groupStageObject!.index] ?? 0 { if counts[$0.groupStageObject!.index] ?? 0 == counts[$1.groupStageObject!.index] ?? 0 {
if simultaneousStart { return $0.groupStageObject!.index < $1.groupStageObject!.index
return $0.groupStageObject!.orderedIndexOfMatch($0) < $1.groupStageObject!.orderedIndexOfMatch($1)
} else {
return $0.groupStageObject!.index < $1.groupStageObject!.index
}
} else { } else {
return counts[$0.groupStageObject!.index] ?? 0 < counts[$1.groupStageObject!.index] ?? 0 return counts[$0.groupStageObject!.index] ?? 0 < counts[$1.groupStageObject!.index] ?? 0
} }

Loading…
Cancel
Save