]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: change list to set
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Thu, 5 Apr 2018 23:13:55 +0000 (07:13 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 10 Apr 2018 02:05:13 +0000 (10:05 +0800)
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>
BaseTools/Source/Python/AutoGen/AutoGen.py

index b8d8d194156286154c4184a4e9688d60ceeb8876..ac608599617266c5b85fb918b7ff9beabbe09a51 100644 (file)
@@ -3915,7 +3915,7 @@ class ModuleAutoGen(AutoGen):
     ## Create AsBuilt INF file the module\r
     #\r
     def CreateAsBuiltInf(self, IsOnlyCopy = False):\r
-        self.OutputFile = []\r
+        self.OutputFile = set()\r
         if IsOnlyCopy:\r
             if GlobalData.gBinCacheDest:\r
                 self.CopyModuleToCache()\r
@@ -4056,8 +4056,7 @@ class ModuleAutoGen(AutoGen):
         DebugDir = self.DebugDir.replace('\\', '/').strip('/')\r
         for Item in self.CodaTargetList:\r
             File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')\r
-            if File not in self.OutputFile:\r
-                self.OutputFile.append(File)\r
+            self.OutputFile.add(File)\r
             if os.path.isabs(File):\r
                 File = File.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/')\r
             if Item.Target.Ext.lower() == '.aml':\r
@@ -4069,8 +4068,7 @@ class ModuleAutoGen(AutoGen):
             else:\r
                 AsBuiltInfDict['binary_item'] += ['BIN|' + File]\r
         if self.DepexGenerated:\r
-            if self.Name + '.depex' not in self.OutputFile:\r
-                self.OutputFile.append(self.Name + '.depex')\r
+            self.OutputFile.add(self.Name + '.depex')\r
             if self.ModuleType in ['PEIM']:\r
                 AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']\r
             if self.ModuleType in ['DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'UEFI_DRIVER']:\r
@@ -4081,15 +4079,13 @@ class ModuleAutoGen(AutoGen):
         Bin = self._GenOffsetBin()\r
         if Bin:\r
             AsBuiltInfDict['binary_item'] += ['BIN|%s' % Bin]\r
-            if Bin not in self.OutputFile:\r
-                self.OutputFile.append(Bin)\r
+            self.OutputFile.add(Bin)\r
 \r
         for Root, Dirs, Files in os.walk(OutputDir):\r
             for File in Files:\r
                 if File.lower().endswith('.pdb'):\r
                     AsBuiltInfDict['binary_item'] += ['DISPOSABLE|' + File]\r
-                    if File not in self.OutputFile:\r
-                        self.OutputFile.append(File)\r
+                    self.OutputFile.add(File)\r
         HeaderComments = self.Module.HeaderComments\r
         StartPos = 0\r
         for Index in range(len(HeaderComments)):\r