summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-08-29 06:50:34 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-08-30 21:08:49 +0800
commita77e5bcac54d2e2437d7deaec9af5362c9220037 (patch)
treeb7a7cf15e20041767772d1180ea449acf8a48c6d /BaseTools/Source
parentf5f4667dae711a7e34c75a4cd8f7a683c732a566 (diff)
downloadedk2-a77e5bcac54d2e2437d7deaec9af5362c9220037.tar.gz
edk2-a77e5bcac54d2e2437d7deaec9af5362c9220037.tar.bz2
edk2-a77e5bcac54d2e2437d7deaec9af5362c9220037.zip
BaseTools: minimize assignment processing
Reverse the checking and only assign once to each variable. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@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')
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index ca20f8dd6c..eeeb08b4b6 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1534,15 +1534,16 @@ class DscBuildData(PlatformBuildClassObject):
PcdValueDict[PcdCName, TokenSpaceGuid] = {SkuName:(PcdValue, DatumType, MaxDatumSize)}
for ((PcdCName, TokenSpaceGuid), PcdSetting) in PcdValueDict.iteritems():
- PcdValue = None
- DatumType = None
- MaxDatumSize = None
- if TAB_COMMON in PcdSetting:
- PcdValue, DatumType, MaxDatumSize = PcdSetting[TAB_COMMON]
- if TAB_DEFAULT in PcdSetting:
- PcdValue, DatumType, MaxDatumSize = PcdSetting[TAB_DEFAULT]
if self.SkuIdMgr.SystemSkuId in PcdSetting:
PcdValue, DatumType, MaxDatumSize = PcdSetting[self.SkuIdMgr.SystemSkuId]
+ elif TAB_DEFAULT in PcdSetting:
+ PcdValue, DatumType, MaxDatumSize = PcdSetting[TAB_DEFAULT]
+ elif TAB_COMMON in PcdSetting:
+ PcdValue, DatumType, MaxDatumSize = PcdSetting[TAB_COMMON]
+ else:
+ PcdValue = None
+ DatumType = None
+ MaxDatumSize = None
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
PcdCName,