Reviewed-by: Yonghong Zhu <[email protected]> 

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Carsey, Jaben 
Sent: Wednesday, March 28, 2018 7:43 AM
To: [email protected]
Cc: Gao, Liming <[email protected]>; Zhu, Yonghong <[email protected]>
Subject: [PATCH v1 4/4] BaseTools: dont use enumerate when un-needed

Since we only use the item from the list and not the numeric value, dont bother 
with enumerate()

Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <[email protected]>
---
 BaseTools/Source/Python/Common/Expression.py                 | 4 ++--
 BaseTools/Source/Python/Common/Misc.py                       | 2 +-
 BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py 
b/BaseTools/Source/Python/Common/Expression.py
index 340c50ebe00f..f28d770aad94 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -856,7 +856,7 @@ class ValueExpressionEx(ValueExpression):
                         LabelDict = {}
                         NewPcdValueList = []
                         LabelOffset = 0
-                        for Index, Item in enumerate(PcdValueList):
+                        for Item in PcdValueList:
                             # compute byte offset of every LABEL
                             LabelList = _ReLabel.findall(Item)
                             Item = _ReLabel.sub('', Item) @@ -882,7 +882,7 @@ 
class ValueExpressionEx(ValueExpression):
                                 except:
                                     LabelOffset = LabelOffset + 1
 
-                        for Index, Item in enumerate(PcdValueList):
+                        for Item in PcdValueList:
                             # for LABEL parse
                             Item = Item.strip()
                             try:
diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 7d44fdcf8ba7..8f479ace4cb1 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -76,7 +76,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames):
 def _parseForXcode(lines, efifilepath, varnames):
     status = 0
     ret = []
-    for index, line in enumerate(lines):
+    for line in lines:
         line = line.strip()
         if status == 0 and line == "# Symbols:":
             status = 1
diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py 
b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
index fdad5a44dc3d..0a701158e2c2 100644
--- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
+++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
@@ -65,7 +65,7 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
 def _parseForXcode(lines, efifilepath):
     status = 0
     pcds = []
-    for index, line in enumerate(lines):
+    for line in lines:
         line = line.strip()
         if status == 0 and line == "# Symbols:":
             status = 1
--
2.16.2.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to