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 <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>
This commit is contained in:
parent
38504ad3e3
commit
e52aed0d85
@ -899,7 +899,7 @@ class ValueExpressionEx(ValueExpression):
|
|||||||
LabelDict = {}
|
LabelDict = {}
|
||||||
NewPcdValueList = []
|
NewPcdValueList = []
|
||||||
LabelOffset = 0
|
LabelOffset = 0
|
||||||
for Index, Item in enumerate(PcdValueList):
|
for Item in PcdValueList:
|
||||||
# compute byte offset of every LABEL
|
# compute byte offset of every LABEL
|
||||||
LabelList = _ReLabel.findall(Item)
|
LabelList = _ReLabel.findall(Item)
|
||||||
Item = _ReLabel.sub('', Item)
|
Item = _ReLabel.sub('', Item)
|
||||||
@ -925,7 +925,7 @@ class ValueExpressionEx(ValueExpression):
|
|||||||
except:
|
except:
|
||||||
LabelOffset = LabelOffset + 1
|
LabelOffset = LabelOffset + 1
|
||||||
|
|
||||||
for Index, Item in enumerate(PcdValueList):
|
for Item in PcdValueList:
|
||||||
# for LABEL parse
|
# for LABEL parse
|
||||||
Item = Item.strip()
|
Item = Item.strip()
|
||||||
try:
|
try:
|
||||||
|
@ -76,7 +76,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames):
|
|||||||
def _parseForXcode(lines, efifilepath, varnames):
|
def _parseForXcode(lines, efifilepath, varnames):
|
||||||
status = 0
|
status = 0
|
||||||
ret = []
|
ret = []
|
||||||
for index, line in enumerate(lines):
|
for line in lines:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if status == 0 and line == "# Symbols:":
|
if status == 0 and line == "# Symbols:":
|
||||||
status = 1
|
status = 1
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# PCD Name Offset in binary
|
# PCD Name Offset in binary
|
||||||
# ======== ================
|
# ======== ================
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -65,7 +65,7 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
|
|||||||
def _parseForXcode(lines, efifilepath):
|
def _parseForXcode(lines, efifilepath):
|
||||||
status = 0
|
status = 0
|
||||||
pcds = []
|
pcds = []
|
||||||
for index, line in enumerate(lines):
|
for line in lines:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if status == 0 and line == "# Symbols:":
|
if status == 0 and line == "# Symbols:":
|
||||||
status = 1
|
status = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user