diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-03-28 07:42:45 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-03-29 16:28:11 +0800 |
commit | 663b9e061ed1b48e562159e51333e996f1efc830 (patch) | |
tree | 65d757f6313e958bd7026ff0a3032c5642334a9e /BaseTools/Source/Python/Common | |
parent | 56326323e6579d4cde9802c684baba06acbdb1d2 (diff) | |
download | edk2-663b9e061ed1b48e562159e51333e996f1efc830.tar.gz edk2-663b9e061ed1b48e562159e51333e996f1efc830.tar.bz2 edk2-663b9e061ed1b48e562159e51333e996f1efc830.zip |
BaseTools: expression can use single in instead of 3 API calls.
change 3 StartsWith() calls to a single 'in' operation.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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')
-rw-r--r-- | BaseTools/Source/Python/Common/Expression.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index 683604cab5..30711cedd7 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -991,7 +991,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]
|