BaseTools: AutoGen - move constructor out of loop

Create the 2 comparison objects once outside the loop.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Jaben Carsey 2018-06-28 00:10:40 +08:00 committed by Yonghong Zhu
parent 7c12d613ba
commit b420d98502
1 changed files with 4 additions and 2 deletions

View File

@ -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], " \