added express
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user