fix issue with groupstage possible crash when calculating score

add the ability to always create a final table structure
newoffer2025
Razmig Sarkissian 3 months ago
parent 4579ced7a2
commit 9c8f88ed45
  1. 2
      PadelClubData/Data/Match.swift

@ -875,7 +875,7 @@ defer {
let endedSetsTwo = teamScoreOtherTeam.score?.components(separatedBy: ",").compactMap({ $0.components(separatedBy: "-").first }).compactMap({ Int($0) }) ?? matchFormat.defaultWalkOutScore(teamScoreOtherTeam.isWalkOut())
var setDifference : Int = 0
let zip = zip(endedSetsOne, endedSetsTwo)
if matchFormat.setsToWin == 1 {
if matchFormat.setsToWin == 1, endedSetsOne.count > 0, endedSetsTwo.count > 0 {
setDifference = endedSetsOne[0] - endedSetsTwo[0]
} else {
setDifference = zip.filter { $0 > $1 }.count - zip.filter { $1 > $0 }.count

Loading…
Cancel
Save