fixed compile errors

This commit is contained in:
Michael Simard
2020-12-22 11:25:58 -06:00
parent 068932195b
commit d58d91110b

View File

@@ -69,7 +69,7 @@ struct StatsController: RouteCollection {
func getStats(matches:[Match]) -> Stats{ func getStats(matches:[Match]) -> Stats{
let countedMatches = matches.filter { let countedMatches = matches.filter {
return shouldCountMatch(match: $0) return self.shouldCountMatch(match: $0)
} }
let totals = countedMatches.reduce([0,0]) { (totals, match) -> [Int] in let totals = countedMatches.reduce([0,0]) { (totals, match) -> [Int] in
@@ -109,7 +109,7 @@ struct StatsController: RouteCollection {
match.date.day == lastDayPlayed?.day && match.date.day == lastDayPlayed?.day &&
match.date.month == lastDayPlayed?.month && match.date.month == lastDayPlayed?.month &&
match.date.year == lastDayPlayed?.year && match.date.year == lastDayPlayed?.year &&
shouldCountMatch(match: match) self.shouldCountMatch(match: match)
if let game = game { if let game = game {
// if game == "mw" { // if game == "mw" {
@@ -555,11 +555,11 @@ struct StatsController: RouteCollection {
// print ( Date().timeIntervalSince(startTime)) // print ( Date().timeIntervalSince(startTime))
let mwStats = self.getStatsWithMostRecentDailyRecord(matches: matches.filter({ (match) -> Bool in let mwStats = self.getStatsWithMostRecentDailyRecord(matches: matches.filter({ (match) -> Bool in
return match.codGame == "mw" && shouldCountMatch(match: match ) return match.codGame == "mw" && self.shouldCountMatch(match: match )
})) }))
let bocwStats = self.getStatsWithMostRecentDailyRecord(matches: matches.filter({ (match) -> Bool in let bocwStats = self.getStatsWithMostRecentDailyRecord(matches: matches.filter({ (match) -> Bool in
return match.codGame == "bocw" && shouldCountMatch(match: match ) return match.codGame == "bocw" && self.shouldCountMatch(match: match )
})) }))
let mostRecentDailyStats = self.mostRecentDailyStats(matches: matches) let mostRecentDailyStats = self.mostRecentDailyStats(matches: matches)