BaseTools: simplify testing for existance and containing data

and remove a duplicate "if" block from 6 lines up.

Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <[email protected]>
Reviewed-by: Yonghong Zhu <[email protected]>
This commit is contained in:
Carsey, Jaben authored and Yonghong Zhu committed 2018-04-10 10:05:13 +08:00
1 parent ac55e47818
commit 6be947438f
1 file changed
+7 -9
+7 -9
View File
@@ -2352,17 +2352,15 @@ class PlatformAutoGen(AutoGen):
ToPcd.Type, Module, FromPcd.Type),
File=self.MetaFile)
if FromPcd.MaxDatumSize not in [None, '']:
if FromPcd.MaxDatumSize:
ToPcd.MaxDatumSize = FromPcd.MaxDatumSize
if FromPcd.DefaultValue not in [None, '']:
if FromPcd.DefaultValue:
ToPcd.DefaultValue = FromPcd.DefaultValue
if FromPcd.TokenValue not in [None, '']:
if FromPcd.TokenValue:
ToPcd.TokenValue = FromPcd.TokenValue
if FromPcd.MaxDatumSize not in [None, '']:
ToPcd.MaxDatumSize = FromPcd.MaxDatumSize
if FromPcd.DatumType not in [None, '']:
if FromPcd.DatumType:
ToPcd.DatumType = FromPcd.DatumType
if FromPcd.SkuInfoList not in [None, '', []]:
if FromPcd.SkuInfoList:
ToPcd.SkuInfoList = FromPcd.SkuInfoList
# Add Flexible PCD format parse
if ToPcd.DefaultValue:
@@ -3933,11 +3931,11 @@ class ModuleAutoGen(AutoGen):
return
# Skip the following code for modules with no source files
if self.SourceFileList is None or self.SourceFileList == []:
if not self.SourceFileList:
return
# Skip the following code for modules without any binary files
if self.BinaryFileList <> None and self.BinaryFileList <> []:
if not self.BinaryFileList:
return
### TODO: How to handles mixed source and binary modules