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:
committed by
Yonghong Zhu
parent
1beb268a68
commit
c93356ada9
@ -297,7 +297,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
|
||||
|
||||
# Check value, if value are equal, no need to patch
|
||||
if Pcd.DatumType == TAB_VOID:
|
||||
if Pcd.InfDefaultValue == DefaultValue or DefaultValue in [None, '']:
|
||||
if Pcd.InfDefaultValue == DefaultValue or not DefaultValue:
|
||||
continue
|
||||
# Get the string size from FDF or DSC
|
||||
if DefaultValue[0] == 'L':
|
||||
@ -310,7 +310,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
|
||||
if DscOverride:
|
||||
Pcd.MaxDatumSize = PatchPcd.MaxDatumSize
|
||||
# If no defined the maximum size in DSC, try to get current size from INF
|
||||
if Pcd.MaxDatumSize in ['', None]:
|
||||
if not Pcd.MaxDatumSize:
|
||||
Pcd.MaxDatumSize = str(len(Pcd.InfDefaultValue.split(',')))
|
||||
else:
|
||||
Base1 = Base2 = 10
|
||||
|
Reference in New Issue
Block a user