summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenC.py
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/AutoGen/GenC.py
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/AutoGen/GenC.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenC.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index 89a3e56be3..6a2ea924f6 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -866,7 +866,7 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH):
def GetPcdSize(Pcd):
if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:
Value = Pcd.DefaultValue
- if Value in [None, '']:
+ if not Value:
return 1
elif Value[0] == 'L':
return (len(Value) - 2) * 2