BaseTools: remove redundant if comparison

inherently python will check string and list for None and having data

if <x> in [None, ''] and similar are superflous.

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>
This commit is contained in:
Carsey, Jaben
2018-04-20 23:51:42 +08:00
committed by Yonghong Zhu
parent 1beb268a68
commit c93356ada9
6 changed files with 37 additions and 37 deletions

View File

@ -866,7 +866,7 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH):
def GetPcdSize(Pcd):
if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:
Value = Pcd.DefaultValue
if Value in [None, '']:
if not Value:
return 1
elif Value[0] == 'L':
return (len(Value) - 2) * 2