]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: simplify testing for existance and containing data
[mirror_edk2.git] / 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