summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>2018-04-06 07:13:56 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-04-10 10:05:13 +0800
commit6be947438f746baf16afe290ec4ca23ade71400f (patch)
tree6ea5e55e6b6aa3131714e2485ecad60f134ee689
parentac55e47818a960fe1d3f9047035ebfa8a59ca227 (diff)
downloadedk2-6be947438f746baf16afe290ec4ca23ade71400f.zip
edk2-6be947438f746baf16afe290ec4ca23ade71400f.tar.gz
edk2-6be947438f746baf16afe290ec4ca23ade71400f.tar.bz2
BaseTools: simplify testing for existance and containing data
and remove a duplicate "if" block from 6 lines up. 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>
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index ac60859..562f3f63 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -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