]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/BuildEngine.py
BaseTools: Optimizing code for function doesn't match
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / BuildEngine.py
index 8a32343846569f33258c2de62029615fdca13afe..4291da9001b8b4744f4f76bc65fdd15999e784ca 100644 (file)
@@ -530,26 +530,24 @@ class BuildRule:
     #\r
     #   @param  LineIndex   The line index of build rule text\r
     #\r
-    def ParseInputFile(self, LineIndex):\r
+    def ParseInputFileSubSection(self, LineIndex):\r
         FileList = [File.strip() for File in self.RuleContent[LineIndex].split(",")]\r
         for ToolChainFamily in self._FamilyList:\r
-            InputFiles = self._RuleInfo[ToolChainFamily, self._State]\r
-            if InputFiles is None:\r
-                InputFiles = []\r
-                self._RuleInfo[ToolChainFamily, self._State] = InputFiles\r
-            InputFiles.extend(FileList)\r
+            if self._RuleInfo[ToolChainFamily, self._State] is None:\r
+                self._RuleInfo[ToolChainFamily, self._State] = []\r
+            self._RuleInfo[ToolChainFamily, self._State].extend(FileList)\r
 \r
     ## Parse <ExtraDependency> sub-section\r
+    ## Parse <OutputFile> sub-section\r
+    ## Parse <Command> sub-section\r
     #\r
     #   @param  LineIndex   The line index of build rule text\r
     #\r
-    def ParseCommon(self, LineIndex):\r
+    def ParseCommonSubSection(self, LineIndex):\r
         for ToolChainFamily in self._FamilyList:\r
-            Items = self._RuleInfo[ToolChainFamily, self._State]\r
-            if Items is None:\r
-                Items = []\r
-                self._RuleInfo[ToolChainFamily, self._State] = Items\r
-            Items.append(self.RuleContent[LineIndex])\r
+            if self._RuleInfo[ToolChainFamily, self._State] is None:\r
+                self._RuleInfo[ToolChainFamily, self._State] = []\r
+            self._RuleInfo[ToolChainFamily, self._State].append(self.RuleContent[LineIndex])\r
 \r
     ## Get a build rule via [] operator\r
     #\r
@@ -584,10 +582,10 @@ class BuildRule:
         _Section           : ParseSection,\r
         _SubSectionHeader  : ParseSubSectionHeader,\r
         _SubSection        : ParseSubSection,\r
-        _InputFile         : ParseInputFile,\r
-        _OutputFile        : ParseCommon,\r
-        _ExtraDependency   : ParseCommon,\r
-        _Command           : ParseCommon,\r
+        _InputFile         : ParseInputFileSubSection,\r
+        _OutputFile        : ParseCommonSubSection,\r
+        _ExtraDependency   : ParseCommonSubSection,\r
+        _Command           : ParseCommonSubSection,\r
         _UnknownSection    : SkipSection,\r
     }\r
 \r