]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: simplify testing for existance and containing data
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Thu, 5 Apr 2018 23:13:56 +0000 (07:13 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 10 Apr 2018 02:05:13 +0000 (10:05 +0800)
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>
BaseTools/Source/Python/AutoGen/AutoGen.py

index ac608599617266c5b85fb918b7ff9beabbe09a51..562f3f63fc6054cb6e1a533841e3c5ffbdc0bd0c 100644 (file)
@@ -2352,17 +2352,15 @@ class PlatformAutoGen(AutoGen):
                                              ToPcd.Type, Module, FromPcd.Type),\r
                                           File=self.MetaFile)\r
 \r
-            if FromPcd.MaxDatumSize not in [None, '']:\r
+            if FromPcd.MaxDatumSize:\r
                 ToPcd.MaxDatumSize = FromPcd.MaxDatumSize\r
-            if FromPcd.DefaultValue not in [None, '']:\r
+            if FromPcd.DefaultValue:\r
                 ToPcd.DefaultValue = FromPcd.DefaultValue\r
-            if FromPcd.TokenValue not in [None, '']:\r
+            if FromPcd.TokenValue:\r
                 ToPcd.TokenValue = FromPcd.TokenValue\r
-            if FromPcd.MaxDatumSize not in [None, '']:\r
-                ToPcd.MaxDatumSize = FromPcd.MaxDatumSize\r
-            if FromPcd.DatumType not in [None, '']:\r
+            if FromPcd.DatumType:\r
                 ToPcd.DatumType = FromPcd.DatumType\r
-            if FromPcd.SkuInfoList not in [None, '', []]:\r
+            if FromPcd.SkuInfoList:\r
                 ToPcd.SkuInfoList = FromPcd.SkuInfoList\r
             # Add Flexible PCD format parse\r
             if ToPcd.DefaultValue:\r
@@ -3933,11 +3931,11 @@ class ModuleAutoGen(AutoGen):
             return\r
             \r
         # Skip the following code for modules with no source files\r
-        if self.SourceFileList is None or self.SourceFileList == []:\r
+        if not self.SourceFileList:\r
             return\r
 \r
         # Skip the following code for modules without any binary files\r
-        if self.BinaryFileList <> None and self.BinaryFileList <> []:\r
+        if not self.BinaryFileList:\r
             return\r
             \r
         ### TODO: How to handles mixed source and binary modules\r