From b420d9850282ebbcb452ce24ac42f27802fa0c70 Mon Sep 17 00:00:00 2001 From: Jaben Carsey Date: Thu, 28 Jun 2018 00:10:40 +0800 Subject: [PATCH] BaseTools: AutoGen - move constructor out of loop Create the 2 comparison objects once outside the loop. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index c8009d04d7..6d76afd81a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3202,14 +3202,16 @@ class ModuleAutoGen(AutoGen): def _GetSourceFileList(self): if self._SourceFileList is None: self._SourceFileList = [] + ToolChainTagSet = {"", "*", self.ToolChain} + ToolChainFamilySet = {"", "*", self.ToolChainFamily, self.BuildRuleFamily} for F in self.Module.Sources: # match tool chain - if F.TagName not in ("", "*", self.ToolChain): + if F.TagName not in ToolChainTagSet: EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for processing file [%s] is found, " "but [%s] is needed" % (F.TagName, str(F), self.ToolChain)) continue # match tool chain family or build rule family - if F.ToolChainFamily not in ("", "*", self.ToolChainFamily, self.BuildRuleFamily): + if F.ToolChainFamily not in ToolChainFamilySet: EdkLogger.debug( EdkLogger.DEBUG_0, "The file [%s] must be built by tools of [%s], " \ -- 2.39.2