summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/Expression.py
diff options
context:
space:
mode:
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>2018-03-14 07:11:31 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-03-19 09:24:31 +0800
commitae4cc2b084a67d671a116808ac82e59ab770afc0 (patch)
tree89c10ea905d42058fd3eb0ece177063b3892e97d /BaseTools/Source/Python/Common/Expression.py
parent7ccc9c954c5c8a5b92199e68227384da0b5e4e7d (diff)
downloadedk2-ae4cc2b084a67d671a116808ac82e59ab770afc0.tar.gz
edk2-ae4cc2b084a67d671a116808ac82e59ab770afc0.tar.bz2
edk2-ae4cc2b084a67d671a116808ac82e59ab770afc0.zip
BaseTools: Expression - remove redundant variable
Str is created and not needed. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@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>
Diffstat (limited to 'BaseTools/Source/Python/Common/Expression.py')
-rw-r--r--BaseTools/Source/Python/Common/Expression.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py
index e76f09c367..bcb27ec11f 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -46,14 +46,13 @@ ERR_IN_OPERAND = 'Macro after IN operator can only be: $(FAMILY), $(ARC
#
def SplitString(String):
# There might be escaped quote: "abc\"def\\\"ghi", 'abc\'def\\\'ghi'
- Str = String
RetList = []
InSingleQuote = False
InDoubleQuote = False
Item = ''
- for i, ch in enumerate(Str):
+ for i, ch in enumerate(String):
if ch == '"' and not InSingleQuote:
- if Str[i - 1] != '\\':
+ if String[i - 1] != '\\':
InDoubleQuote = not InDoubleQuote
if not InDoubleQuote:
Item += String[i]
@@ -64,7 +63,7 @@ def SplitString(String):
RetList.append(Item)
Item = ''
elif ch == "'" and not InDoubleQuote:
- if Str[i - 1] != '\\':
+ if String[i - 1] != '\\':
InSingleQuote = not InSingleQuote
if not InSingleQuote:
Item += String[i]
@@ -84,13 +83,12 @@ def SplitString(String):
def SplitPcdValueString(String):
# There might be escaped comma in GUID() or DEVICE_PATH() or " "
# or ' ' or L' ' or L" "
- Str = String
RetList = []
InParenthesis = 0
InSingleQuote = False
InDoubleQuote = False
Item = ''
- for i, ch in enumerate(Str):
+ for i, ch in enumerate(String):
if ch == '(':
InParenthesis += 1
if ch == ')':