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.24; helo=mga09.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 EF2B121BADAB9 for ; Tue, 7 Aug 2018 17:49:22 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 17:49:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="73595616" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 07 Aug 2018 17:49:01 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 17:49:00 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Wed, 8 Aug 2018 08:48:59 +0800 From: "Zhu, Yonghong" To: "Feng, YunhuaX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH] BaseTools: Optimizing code for function doesn't match Thread-Index: AdQtIkmzWD8U7FR0SzKpodb8e26+mgBj0xCw Date: Wed, 8 Aug 2018 00:48:59 +0000 Message-ID: References: <47C64442C08CCD4089DC43B6B5E46BC48AC6FF@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC48AC6FF@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Wed, 08 Aug 2018 00:49:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Feng, YunhuaX=20 Sent: Monday, August 06, 2018 9:11 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong ; Gao, Liming Subject: [PATCH] BaseTools: Optimizing code for function doesn't match 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,=20 + 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,=20 + self._State].append(self.RuleContent[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. -- 2.12.2.windows.2