From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,450,1526367600"; d="dat'59?scan'59,208,59";a="70399988" 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 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Zhu, Yonghong" , "Gao, Liming" 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 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: [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: , X-List-Received-Date: Mon, 06 Aug 2018 01:10:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 --- 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 InputFile= s - 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