From c93356ada99e6f8083a64f99d162b44a2765ce63 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Fri, 20 Apr 2018 23:51:42 +0800 Subject: BaseTools: remove redundant if comparison inherently python will check string and list for None and having data if in [None, ''] and similar are superflous. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/DscBuildData.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py') 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]): -- cgit v1.2.3