summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-08-06 09:10:39 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-08-16 14:46:53 +0800
commit7b85a1afa38c13fd40095f277cd26e5aa159b2f5 (patch)
treed9aa65157dbfda8ce2b182435a65912810194cb0
parent4fea08b9c9df2271de5200a1dd3189ddbf525922 (diff)
downloadedk2-7b85a1afa38c13fd40095f277cd26e5aa159b2f5.zip
edk2-7b85a1afa38c13fd40095f277cd26e5aa159b2f5.tar.gz
edk2-7b85a1afa38c13fd40095f277cd26e5aa159b2f5.tar.bz2
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 <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
-rw-r--r--BaseTools/Source/Python/AutoGen/BuildEngine.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py
index 8a32343..4291da9 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 <ExtraDependency> sub-section
+ ## Parse <OutputFile> sub-section
+ ## Parse <Command> 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,
}