From nobody Fri Apr 26 23:49:26 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1533517846098843.6515232971934; Sun, 5 Aug 2018 18:10:46 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1EFFE210DA15C; Sun, 5 Aug 2018 18:10:45 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 385A0210DA14C for ; Sun, 5 Aug 2018 18:10:43 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2018 18:10:42 -0700 Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 05 Aug 2018 18:10:42 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 5 Aug 2018 18:10:42 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.57]) with mapi id 14.03.0319.002; Mon, 6 Aug 2018 09:10:40 +0800 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.65; helo=mga03.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,450,1526367600"; d="dat'59?scan'59,208,59";a="70399988" From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools: Optimizing code for function doesn't match Thread-Index: AdQtIkmzWD8U7FR0SzKpodb8e26+mg== Date: Mon, 6 Aug 2018 01:10:39 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC48AC6FF@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC48AC6FF@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.27 Subject: [edk2] [PATCH] BaseTools: Optimizing code for function doesn't match X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gao, Liming" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RDMRC_1 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Optimizing code for function doesn't match name and comment Fix https://bugzilla.tianocore.org/show_bug.cgi?id=3D924 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/BuildEngine.py | 30 ++++++++++++----------= ---- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Sou= rce/Python/AutoGen/BuildEngine.py index 8a32343846..4291da9001 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -528,30 +528,28 @@ class BuildRule: ExtraData=3D"Unknown subsection: %s" % self.Ru= leContent[LineIndex]) ## Parse sub-section # # @param LineIndex The line index of build rule text # - def ParseInputFile(self, LineIndex): + def ParseInputFileSubSection(self, LineIndex): FileList =3D [File.strip() for File in self.RuleContent[LineIndex]= .split(",")] for ToolChainFamily in self._FamilyList: - InputFiles =3D self._RuleInfo[ToolChainFamily, self._State] - if InputFiles is None: - InputFiles =3D [] - self._RuleInfo[ToolChainFamily, self._State] =3D InputFiles - InputFiles.extend(FileList) + if self._RuleInfo[ToolChainFamily, self._State] is None: + self._RuleInfo[ToolChainFamily, self._State] =3D [] + self._RuleInfo[ToolChainFamily, self._State].extend(FileList) =20 ## Parse sub-section + ## Parse sub-section + ## Parse sub-section # # @param LineIndex The line index of build rule text # - def ParseCommon(self, LineIndex): + def ParseCommonSubSection(self, LineIndex): for ToolChainFamily in self._FamilyList: - Items =3D self._RuleInfo[ToolChainFamily, self._State] - if Items is None: - Items =3D [] - self._RuleInfo[ToolChainFamily, self._State] =3D Items - Items.append(self.RuleContent[LineIndex]) + if self._RuleInfo[ToolChainFamily, self._State] is None: + self._RuleInfo[ToolChainFamily, self._State] =3D [] + self._RuleInfo[ToolChainFamily, self._State].append(self.RuleC= ontent[LineIndex]) =20 ## Get a build rule via [] operator # # @param FileExt The extension of a file # @param ToolChainFamily The tool chain family name @@ -582,14 +580,14 @@ class BuildRule: _StateHandler =3D { _SectionHeader : ParseSectionHeader, _Section : ParseSection, _SubSectionHeader : ParseSubSectionHeader, _SubSection : ParseSubSection, - _InputFile : ParseInputFile, - _OutputFile : ParseCommon, - _ExtraDependency : ParseCommon, - _Command : ParseCommon, + _InputFile : ParseInputFileSubSection, + _OutputFile : ParseCommonSubSection, + _ExtraDependency : ParseCommonSubSection, + _Command : ParseCommonSubSection, _UnknownSection : SkipSection, } =20 # This acts like the main() function for the script, unless it is 'import'= ed into another # script. --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel