[edk2] [PATCH v1 2/4] BaseTools: use in to compare single chars

Jaben Carsey posted 4 patches 7 years, 3 months ago
[edk2] [PATCH v1 2/4] BaseTools: use in to compare single chars
Posted by Jaben Carsey 7 years, 3 months ago
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>
---
 BaseTools/Source/Python/Common/Expression.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py
index 4a3dea1190b2..51f83ad4c7a4 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -835,7 +835,7 @@ class ValueExpressionEx(ValueExpression):
                         elif Item.startswith('UINT64'):
                             ItemSize = 8
                             ValueType = 'UINT64'
-                        elif Item.startswith('"') or Item.startswith("'") or Item.startswith('L'):
+                        elif Item[0] in ['"',"'",'L']:
                             ItemSize = 0
                             ValueType = 'VOID*'
                         else:
-- 
2.16.2.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel