Reviewed-by: Yonghong Zhu <[email protected]> 

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Carsey, Jaben 
Sent: Wednesday, March 28, 2018 7:43 AM
To: [email protected]
Cc: Gao, Liming <[email protected]>; Zhu, Yonghong <[email protected]>
Subject: [PATCH v1 2/4] BaseTools: expression can use single in instead of 3 
API calls.

change 3 StartsWith() calls to a single 'in' operation.

Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <[email protected]>
---
 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 b70f7da1233e..3f2b43118553 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -948,7 +948,7 @@ class ValueExpressionEx(ValueExpression):
                                 Item = '0x%x' % TmpValue if type(TmpValue) != 
type('') else TmpValue
                                 if ItemSize == 0:
                                     ItemValue, ItemSize = ParseFieldValue(Item)
-                                    if not (Item.startswith('"') or 
Item.startswith('L') or Item.startswith('{')) and ItemSize > 1:
+                                    if Item[0] not in ['"','L','{'] and 
ItemSize > 1:
                                         raise BadExpression("Byte  array 
number %s should less than 0xFF." % Item)
                                 else:
                                     ItemValue = ParseFieldValue(Item)[0]
-- 
2.16.2.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to