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>
This commit is contained in:
Carsey, Jaben 2018-08-29 06:50:34 +08:00 committed by Yonghong Zhu
parent f5f4667dae
commit a77e5bcac5
1 changed files with 8 additions and 7 deletions

View File

@ -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,