Module:MLB standings: Difference between revisions

Content deleted Content added
eliminate use of local flag by checking sequence length instead
No edit summary
Line 70:
args[currentIdx+2] == nil or
args[currentIdx+3] == nil or
args[currentIdx+4] == nil or) then
args[currentIdx+5] == nil or
args[currentIdx+6] == nil ) then
return nil
end
returnteamInfo = {
name = mw.text.trim(args[currentIdx]),
wins homeWins = tonumber(mw.text.trim(args[currentIdx+1])),
losses homeLosses = tonumber(mw.text.trim(args[currentIdx+2])),
homeWinsroadWins = tonumber(mw.text.trim(args[currentIdx+3])),
homeLossesroadLosses = tonumber(mw.text.trim(args[currentIdx+4])),
roadWins = mw.text.trim(args[currentIdx+5]),
roadLosses = mw.text.trim(args[currentIdx+6]),
}
teamInfo.wins = teamInfo.homeWins + teamInfo.roadWins
teamInfo.losses = teamInfo.homeLosses + teamInfo.roadLosses
return teamInfo
end -- function readTeamInfo()
 
Line 144 ⟶ 143:
fTeamInfoPresent = true
table.insert(listOfTeams, teamInfo)
currentArgIdx = currentArgIdx + 75
end