BaseTools: use in to compare single chars
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Thu, 29 Mar 2018 00:02:18 +0000 (08:02 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 30 Mar 2018 01:16:27 +0000 (09:16 +0800)
instead if 3 Startswith for single chars, just use in with a list of chars

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 8e1a9866e1eadd3b8de664450861b0822a4f01fc..320f0015009b3c28e16562cda31116b179597e8d 100644 (file)
@@ -835,7 +835,7 @@ class ValueExpressionEx(ValueExpression):
                         elif Item.startswith('UINT64'):\r
                             ItemSize = 8\r
                             ValueType = 'UINT64'\r
-                        elif Item.startswith('"') or Item.startswith("'") or Item.startswith('L'):\r
+                        elif Item[0] in ['"',"'",'L']:\r
                             ItemSize = 0\r
                             ValueType = 'VOID*'\r
                         else:\r