Create the 2 comparison objects once outside the loop.

Cc: Liming Gao <liming....@intel.com>
Cc: Yonghong Zhu <yonghong....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.car...@intel.com>
---
 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 ed0be3bc74f9..6f86185b413d 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3201,14 +3201,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.16.2.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to