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:33 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-03-19 09:25:33 +0800
commit3e8bab960eca8464ab1d0f2ad3f06a2ccc925f95 (patch)
treea95f358aeb8d7fb05bc91b885ca094fe1c03be4d /BaseTools/Source/Python/Common/Expression.py
parent1f901a89f053dfa8c64904a582622a33a669b605 (diff)
downloadedk2-3e8bab960eca8464ab1d0f2ad3f06a2ccc925f95.tar.gz
edk2-3e8bab960eca8464ab1d0f2ad3f06a2ccc925f95.tar.bz2
edk2-3e8bab960eca8464ab1d0f2ad3f06a2ccc925f95.zip
BaseTools: Expression - change from series of if to elif
since the first character of the string cannot be found by multiple if statements, use elif to optomize the behavior. 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.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py
index c7037dd0d0..85c1ce9bbc 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -93,18 +93,18 @@ def SplitPcdValueString(String):
for i, ch in enumerate(String):
if ch == '(':
InParenthesis += 1
- if ch == ')':
+ elif ch == ')':
if InParenthesis:
InParenthesis -= 1
else:
raise BadExpression(ERR_STRING_TOKEN % Item)
- if ch == '"' and not InSingleQuote:
+ elif ch == '"' and not InSingleQuote:
if String[i-1] != '\\':
InDoubleQuote = not InDoubleQuote
- if ch == "'" and not InDoubleQuote:
+ elif ch == "'" and not InDoubleQuote:
if String[i-1] != '\\':
InSingleQuote = not InSingleQuote
- if ch == ',':
+ elif ch == ',':
if InParenthesis or InSingleQuote or InDoubleQuote:
Item += String[i]
continue