From 7b85a1afa38c13fd40095f277cd26e5aa159b2f5 Mon Sep 17 00:00:00 2001 From: Yunhua Feng Date: Mon, 6 Aug 2018 09:10:39 +0800 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=924 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- .../Source/Python/AutoGen/BuildEngine.py | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py index 8a32343846..4291da9001 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -530,26 +530,24 @@ class BuildRule: # # @param LineIndex The line index of build rule text # - def ParseInputFile(self, LineIndex): + def ParseInputFileSubSection(self, LineIndex): FileList = [File.strip() for File in self.RuleContent[LineIndex].split(",")] for ToolChainFamily in self._FamilyList: - InputFiles = self._RuleInfo[ToolChainFamily, self._State] - if InputFiles is None: - InputFiles = [] - self._RuleInfo[ToolChainFamily, self._State] = InputFiles - InputFiles.extend(FileList) + if self._RuleInfo[ToolChainFamily, self._State] is None: + self._RuleInfo[ToolChainFamily, self._State] = [] + self._RuleInfo[ToolChainFamily, self._State].extend(FileList) ## 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 = self._RuleInfo[ToolChainFamily, self._State] - if Items is None: - Items = [] - self._RuleInfo[ToolChainFamily, self._State] = Items - Items.append(self.RuleContent[LineIndex]) + if self._RuleInfo[ToolChainFamily, self._State] is None: + self._RuleInfo[ToolChainFamily, self._State] = [] + self._RuleInfo[ToolChainFamily, self._State].append(self.RuleContent[LineIndex]) ## Get a build rule via [] operator # @@ -584,10 +582,10 @@ class BuildRule: _Section : ParseSection, _SubSectionHeader : ParseSubSectionHeader, _SubSection : ParseSubSection, - _InputFile : ParseInputFile, - _OutputFile : ParseCommon, - _ExtraDependency : ParseCommon, - _Command : ParseCommon, + _InputFile : ParseInputFileSubSection, + _OutputFile : ParseCommonSubSection, + _ExtraDependency : ParseCommonSubSection, + _Command : ParseCommonSubSection, _UnknownSection : SkipSection, } -- 2.39.2