|
|
|
|
@ -458,12 +458,15 @@ final class GroupStage: BaseGroupStage, SideStorable { |
|
|
|
|
var scoreCache: [Int: TeamGroupStageScore] = [:] |
|
|
|
|
|
|
|
|
|
func computedScore(forTeam team: TeamRegistration, step: Int = 0) -> TeamGroupStageScore? { |
|
|
|
|
if let cachedScore = scoreCache[team.groupStagePositionAtStep(step)!] { |
|
|
|
|
guard let groupStagePositionAtStep = team.groupStagePositionAtStep(step) else { |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
if let cachedScore = scoreCache[groupStagePositionAtStep] { |
|
|
|
|
return cachedScore |
|
|
|
|
} else { |
|
|
|
|
let score = _score(forGroupStagePosition: team.groupStagePositionAtStep(step)!) |
|
|
|
|
let score = _score(forGroupStagePosition: groupStagePositionAtStep) |
|
|
|
|
if let score = score { |
|
|
|
|
scoreCache[team.groupStagePositionAtStep(step)!] = score |
|
|
|
|
scoreCache[groupStagePositionAtStep] = score |
|
|
|
|
} |
|
|
|
|
return score |
|
|
|
|
} |
|
|
|
|
|