summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-20 23:51:42 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-02 15:02:20 +0800
commitc93356ada99e6f8083a64f99d162b44a2765ce63 (patch)
tree1bb64928b259fc66d7e8512a116a758b33a465a1 /BaseTools/Source/Python/Workspace
parent1beb268a686344d92f42ced656edf46c626e9413 (diff)
downloadedk2-c93356ada99e6f8083a64f99d162b44a2765ce63.tar.gz
edk2-c93356ada99e6f8083a64f99d162b44a2765ce63.tar.bz2
edk2-c93356ada99e6f8083a64f99d162b44a2765ce63.zip
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>
Diffstat (limited to 'BaseTools/Source/Python/Workspace')
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py8
-rw-r--r--BaseTools/Source/Python/Workspace/InfBuildData.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 6aaa21db5d..067e8cf632 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -635,10 +635,10 @@ class DscBuildData(PlatformBuildClassObject):
self._SkuIds = OrderedDict()
RecordList = self._RawData[MODEL_EFI_SKU_ID, self._Arch]
for Record in RecordList:
- if Record[0] in [None, '']:
+ if not Record[0]:
EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID number',
File=self.MetaFile, Line=Record[-1])
- if Record[1] in [None, '']:
+ if not Record[1]:
EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID name',
File=self.MetaFile, Line=Record[-1])
if not Pattern.match(Record[0]) and not HexPattern.match(Record[0]):
@@ -663,10 +663,10 @@ class DscBuildData(PlatformBuildClassObject):
self.DefaultStores = OrderedDict()
RecordList = self._RawData[MODEL_EFI_DEFAULT_STORES, self._Arch]
for Record in RecordList:
- if Record[0] in [None, '']:
+ if not Record[0]:
EdkLogger.error('build', FORMAT_INVALID, 'No DefaultStores ID number',
File=self.MetaFile, Line=Record[-1])
- if Record[1] in [None, '']:
+ if not Record[1]:
EdkLogger.error('build', FORMAT_INVALID, 'No DefaultStores ID name',
File=self.MetaFile, Line=Record[-1])
if not Pattern.match(Record[0]) and not HexPattern.match(Record[0]):
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py
index cf5e1df3a5..602746de32 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -1116,7 +1116,7 @@ class InfBuildData(ModuleBuildClassObject):
Pcd.DatumType = PcdInPackage.DatumType
Pcd.MaxDatumSize = PcdInPackage.MaxDatumSize
Pcd.InfDefaultValue = Pcd.DefaultValue
- if Pcd.DefaultValue in [None, '']:
+ if not Pcd.DefaultValue:
Pcd.DefaultValue = PcdInPackage.DefaultValue
else:
try: