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>
Item = '0x%x' % TmpValue if type(TmpValue) != type('') else TmpValue\r
if ItemSize == 0:\r
ItemValue, ItemSize = ParseFieldValue(Item)\r
Item = '0x%x' % TmpValue if type(TmpValue) != type('') else TmpValue\r
if ItemSize == 0:\r
ItemValue, ItemSize = ParseFieldValue(Item)\r
- if not (Item.startswith('"') or Item.startswith('L') or Item.startswith('{')) and ItemSize > 1:\r
+ if Item[0] not in ['"','L','{'] and ItemSize > 1:\r
raise BadExpression("Byte array number %s should less than 0xFF." % Item)\r
else:\r
ItemValue = ParseFieldValue(Item)[0]\r
raise BadExpression("Byte array number %s should less than 0xFF." % Item)\r
else:\r
ItemValue = ParseFieldValue(Item)[0]\r