BaseTools: Expression - remove redundant variable
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Tue, 13 Mar 2018 23:11:31 +0000 (07:11 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 19 Mar 2018 01:24:31 +0000 (09:24 +0800)
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>
BaseTools/Source/Python/Common/Expression.py

index e76f09c..bcb27ec 100644 (file)
@@ -46,14 +46,13 @@ ERR_IN_OPERAND          = 'Macro after IN operator can only be: $(FAMILY), $(ARC
 #\r
 def SplitString(String):\r
     # There might be escaped quote: "abc\"def\\\"ghi", 'abc\'def\\\'ghi'\r
-    Str = String\r
     RetList = []\r
     InSingleQuote = False\r
     InDoubleQuote = False\r
     Item = ''\r
-    for i, ch in enumerate(Str):\r
+    for i, ch in enumerate(String):\r
         if ch == '"' and not InSingleQuote:\r
-            if Str[i - 1] != '\\':\r
+            if String[i - 1] != '\\':\r
                 InDoubleQuote = not InDoubleQuote\r
             if not InDoubleQuote:\r
                 Item += String[i]\r
@@ -64,7 +63,7 @@ def SplitString(String):
                 RetList.append(Item)\r
                 Item = ''\r
         elif ch == "'" and not InDoubleQuote:\r
-            if Str[i - 1] != '\\':\r
+            if String[i - 1] != '\\':\r
                 InSingleQuote = not InSingleQuote\r
             if not InSingleQuote:\r
                 Item += String[i]\r
@@ -84,13 +83,12 @@ def SplitString(String):
 def SplitPcdValueString(String):\r
     # There might be escaped comma in GUID() or DEVICE_PATH() or " "\r
     # or ' ' or L' ' or L" "\r
-    Str = String\r
     RetList = []\r
     InParenthesis = 0\r
     InSingleQuote = False\r
     InDoubleQuote = False\r
     Item = ''\r
-    for i, ch in enumerate(Str):\r
+    for i, ch in enumerate(String):\r
         if ch == '(':\r
             InParenthesis += 1\r
         if ch == ')':\r