summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>2018-04-06 07:13:55 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-04-10 10:05:13 +0800
commitac55e47818a960fe1d3f9047035ebfa8a59ca227 (patch)
tree753c539649ea69304dbae5f7c5feae8431d4ae65 /BaseTools
parentd98cce8e6364296909135ba27b53d3b31bff73d2 (diff)
downloadedk2-ac55e47818a960fe1d3f9047035ebfa8a59ca227.tar.gz
edk2-ac55e47818a960fe1d3f9047035ebfa8a59ca227.tar.bz2
edk2-ac55e47818a960fe1d3f9047035ebfa8a59ca227.zip
BaseTools: change list to set
Order is irelevant duplication is auto-prevented 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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index b8d8d19415..ac60859961 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3915,7 +3915,7 @@ class ModuleAutoGen(AutoGen):
## Create AsBuilt INF file the module
#
def CreateAsBuiltInf(self, IsOnlyCopy = False):
- self.OutputFile = []
+ self.OutputFile = set()
if IsOnlyCopy:
if GlobalData.gBinCacheDest:
self.CopyModuleToCache()
@@ -4056,8 +4056,7 @@ class ModuleAutoGen(AutoGen):
DebugDir = self.DebugDir.replace('\\', '/').strip('/')
for Item in self.CodaTargetList:
File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')
- if File not in self.OutputFile:
- self.OutputFile.append(File)
+ self.OutputFile.add(File)
if os.path.isabs(File):
File = File.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/')
if Item.Target.Ext.lower() == '.aml':
@@ -4069,8 +4068,7 @@ class ModuleAutoGen(AutoGen):
else:
AsBuiltInfDict['binary_item'] += ['BIN|' + File]
if self.DepexGenerated:
- if self.Name + '.depex' not in self.OutputFile:
- self.OutputFile.append(self.Name + '.depex')
+ self.OutputFile.add(self.Name + '.depex')
if self.ModuleType in ['PEIM']:
AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']
if self.ModuleType in ['DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'UEFI_DRIVER']:
@@ -4081,15 +4079,13 @@ class ModuleAutoGen(AutoGen):
Bin = self._GenOffsetBin()
if Bin:
AsBuiltInfDict['binary_item'] += ['BIN|%s' % Bin]
- if Bin not in self.OutputFile:
- self.OutputFile.append(Bin)
+ self.OutputFile.add(Bin)
for Root, Dirs, Files in os.walk(OutputDir):
for File in Files:
if File.lower().endswith('.pdb'):
AsBuiltInfDict['binary_item'] += ['DISPOSABLE|' + File]
- if File not in self.OutputFile:
- self.OutputFile.append(File)
+ self.OutputFile.add(File)
HeaderComments = self.Module.HeaderComments
StartPos = 0
for Index in range(len(HeaderComments)):