BaseTools: dont use enumerate when un-needed
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Tue, 27 Mar 2018 23:42:47 +0000 (07:42 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 29 Mar 2018 08:31:24 +0000 (16:31 +0800)
Since we only use the item from the list and not the numeric value,
dont bother with enumerate()

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/Common/Expression.py
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py

index 4a7cd974b1212449a135e21ba0c34b5367476e9b..09240de6978180050be22a554293ce86b38f9593 100644 (file)
@@ -899,7 +899,7 @@ class ValueExpressionEx(ValueExpression):
                         LabelDict = {}\r
                         NewPcdValueList = []\r
                         LabelOffset = 0\r
-                        for Index, Item in enumerate(PcdValueList):\r
+                        for Item in PcdValueList:\r
                             # compute byte offset of every LABEL\r
                             LabelList = _ReLabel.findall(Item)\r
                             Item = _ReLabel.sub('', Item)\r
@@ -925,7 +925,7 @@ class ValueExpressionEx(ValueExpression):
                                 except:\r
                                     LabelOffset = LabelOffset + 1\r
 \r
-                        for Index, Item in enumerate(PcdValueList):\r
+                        for Item in PcdValueList:\r
                             # for LABEL parse\r
                             Item = Item.strip()\r
                             try:\r
index 7d44fdcf8ba73b42107299e65e36a7b4379659fb..8f479ace4cb15fadfbee9da6f65e4b353c3277ba 100644 (file)
@@ -76,7 +76,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames):
 def _parseForXcode(lines, efifilepath, varnames):\r
     status = 0\r
     ret = []\r
-    for index, line in enumerate(lines):\r
+    for line in lines:\r
         line = line.strip()\r
         if status == 0 and line == "# Symbols:":\r
             status = 1\r
index fdad5a44dc3d25cfc0fa9e255f778140095754ad..d30a9a2baa8bb7d71de1ae444e059b45e16c8ccd 100644 (file)
@@ -5,7 +5,7 @@
 #    PCD Name    Offset in binary\r
 #    ========    ================\r
 #\r
-# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -65,7 +65,7 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
 def _parseForXcode(lines, efifilepath):\r
     status = 0\r
     pcds = []\r
-    for index, line in enumerate(lines):\r
+    for line in lines:\r
         line = line.strip()\r
         if status == 0 and line == "# Symbols:":\r
             status = 1\r