From 0541246ecbe136710db110a269721c778f361065 Mon Sep 17 00:00:00 2001 From: Rikard Blixt Date: Wed, 16 Oct 2024 12:33:09 +0200 Subject: [PATCH] clean code --- components/match2/commons/match_summary_base.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/match2/commons/match_summary_base.lua b/components/match2/commons/match_summary_base.lua index 83c8b56f8db..d8ed9420fba 100644 --- a/components/match2/commons/match_summary_base.lua +++ b/components/match2/commons/match_summary_base.lua @@ -849,11 +849,13 @@ function MatchSummary.buildCharacterBanData(games, maxNumberOfBans, defaultIcon) local banData = {{}, {}} local gameHasBans = false for index = 1, maxNumberOfBans do - if String.isNotEmpty(extradata['team1ban' .. index]) or String.isNotEmpty(extradata['team2ban' .. index]) then + local team1ban = String.nilIfEmpty(extradata['team1ban' .. index]) + local team2ban = String.nilIfEmpty(extradata['team2ban' .. index]) + if team1ban or team2ban then gameHasBans = true end - table.insert(banData[1], String.nilIfEmpty(extradata['team1ban' .. index]) or defaultIcon) - table.insert(banData[2], String.nilIfEmpty(extradata['team2ban' .. index]) or defaultIcon) + table.insert(banData[1], team1ban or defaultIcon) + table.insert(banData[2], team2ban or defaultIcon) end if gameHasBans then