From nobody Fri Nov 1 04:42:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970084728799.008344576623; Thu, 5 Apr 2018 16:14:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5FE8522685240; Thu, 5 Apr 2018 16:14:11 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8AF4225264A7 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047113" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:14:00 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 12/14] BaseTools: change more list to set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" potentially accelerate "in" testing remove uncalled function Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 5 ++-- BaseTools/Source/Python/AutoGen/BuildEngine.py | 29 ++++++-------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 42536a61535a..342cd618c605 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -4191,7 +4191,7 @@ class ModuleAutoGen(AutoGen): PcdItem =3D PcdComments + '\n ' + PcdItem AsBuiltInfDict['patchablepcd_item'].append(PcdItem) =20 - HiiPcds =3D [] + HiiPcds =3D set() for Pcd in Pcds + VfrPcds: PcdComments =3D '' PcdCommentList =3D [] @@ -4214,8 +4214,7 @@ class ModuleAutoGen(AutoGen): # if (SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in Hii= Pcds: continue - else: - HiiPcds.append((SkuId, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName)) + HiiPcds.add((SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e)) if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in self._PcdComme= nts: PcdCommentList =3D self._PcdComments[Pcd.TokenSpaceGuidCNa= me, Pcd.TokenCName][:] if HiiInfo: diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Sou= rce/Python/AutoGen/BuildEngine.py index 0daed7da610d..1663ddd21bb0 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -161,7 +161,7 @@ class FileBuildRule: =20 # Check input files self.IsMultipleInput =3D False - self.SourceFileExtList =3D [] + self.SourceFileExtList =3D set() for File in Input: Base, Ext =3D os.path.splitext(File) if Base.find("*") >=3D 0: @@ -172,8 +172,7 @@ class FileBuildRule: # There's no "*" and "?" in file name self.ExtraSourceFileList.append(File) continue - if Ext not in self.SourceFileExtList: - self.SourceFileExtList.append(Ext) + self.SourceFileExtList.add(Ext) =20 # Check output files self.DestFileList =3D [] @@ -194,16 +193,6 @@ class FileBuildRule: CommandString =3D "\n\t".join(self.CommandList) return "%s : %s\n\t%s" % (DestString, SourceString, CommandString) =20 - ## Check if given file extension is supported by this rule - # - # @param FileExt The extension of a file - # - # @retval True If the extension is supported - # @retval False If the extension is not supported - # - def IsSupported(self, FileExt): - return FileExt in self.SourceFileExtList - def Instantiate(self, Macros=3D{}): NewRuleObject =3D copy.copy(self) NewRuleObject.BuildTargets =3D {} @@ -365,8 +354,8 @@ class BuildRule: self._State =3D "" self._RuleInfo =3D tdict(True, 2) # {toolchain family : {"Inpu= tFile": {}, "OutputFile" : [], "Command" : []}} self._FileType =3D '' - self._BuildTypeList =3D [] - self._ArchList =3D [] + self._BuildTypeList =3D set() + self._ArchList =3D set() self._FamilyList =3D [] self._TotalToolChainFamilySet =3D set() self._RuleObjectList =3D [] # FileBuildRule object list @@ -456,8 +445,8 @@ class BuildRule: # def ParseSectionHeader(self, LineIndex): self._RuleInfo =3D tdict(True, 2) - self._BuildTypeList =3D [] - self._ArchList =3D [] + self._BuildTypeList =3D set() + self._ArchList =3D set() self._FamilyList =3D [] self._TotalToolChainFamilySet =3D set() FileType =3D '' @@ -494,10 +483,8 @@ class BuildRule: BuildType =3D TokenList[1] if len(TokenList) > 2: Arch =3D TokenList[2] - if BuildType not in self._BuildTypeList: - self._BuildTypeList.append(BuildType) - if Arch not in self._ArchList: - self._ArchList.append(Arch) + self._BuildTypeList.add(BuildType) + self._ArchList.add(Arch) =20 if 'COMMON' in self._BuildTypeList and len(self._BuildTypeList) > = 1: EdkLogger.error("build", FORMAT_INVALID, --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel