Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lua/wikis/commons/Standings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ function Standings.fetchMatches(standings)
return MatchGroupUtil.splitMatchId(matchid)
end))

local wantedMatchIds = Table.map(matchids, function(_, matchid) return matchid, true end)
local allMatchesFromBrackets = Array.flatMap(bracketIds, MatchGroupUtil.fetchMatches)
return Array.filter(allMatchesFromBrackets, function(match)
return Table.includes(matchids, match.matchId)
return wantedMatchIds[match.matchId]
end)
end

Expand All @@ -193,10 +194,7 @@ function Standings.fetchMatch(entry)
return
end

local allMatchesFromBrackets = MatchGroupUtil.fetchMatches(bracketId)
return Array.filter(allMatchesFromBrackets, function(match)
return match.matchId == matchid
end)[1]
return MatchGroupUtil.fetchMatchGroup(bracketId).matchesById[matchid]
end

---@param standings StandingsModel
Expand Down
Loading