added express

This commit is contained in:
Michael Simard
2021-02-04 14:03:28 -06:00
parent 69829a9f01
commit 74b034e104
2 changed files with 6 additions and 15 deletions

View File

@@ -511,7 +511,6 @@ struct StatsController: RouteCollection {
//print ("cw done \(Date().timeIntervalSince(startTime))")
group.leave()
}
group.enter()
@@ -554,8 +553,7 @@ struct StatsController: RouteCollection {
mwFivePlayers = self.getStatsByPlayerCount(matches: matches, playerCount: 5)
group.leave()
}
group.enter()
queue.async {
@@ -612,27 +610,18 @@ struct StatsController: RouteCollection {
}
let ratio = wins / loss
return records
}
}
func mapsSortedByBest (records :[ Int:Stats] ) -> [ Int ]
{
func mapsSortedByBest (records :[ Int:Stats] ) -> [ Int ] {
return records.keys.sorted { (map1, map2) -> Bool in
return records[map1]?.getRatioDouble() ?? 0.0 < records[map2]?.getRatioDouble() ?? 0.0
}.reversed()
}
func getStatsByPlayerCount(matches:[Match], playerCount:Int) -> Stats {
return getStats(matches: matches.filter{$0.playerList.count == playerCount})
}
func getBestMap (records :[ Int:Stats] ) -> Int {