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:
committed by
Yonghong Zhu
parent
f5f4667dae
commit
a77e5bcac5
@ -1534,15 +1534,16 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
PcdValueDict[PcdCName, TokenSpaceGuid] = {SkuName:(PcdValue, DatumType, MaxDatumSize)}
|
PcdValueDict[PcdCName, TokenSpaceGuid] = {SkuName:(PcdValue, DatumType, MaxDatumSize)}
|
||||||
|
|
||||||
for ((PcdCName, TokenSpaceGuid), PcdSetting) in PcdValueDict.iteritems():
|
for ((PcdCName, TokenSpaceGuid), PcdSetting) in PcdValueDict.iteritems():
|
||||||
|
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
|
PcdValue = None
|
||||||
DatumType = None
|
DatumType = None
|
||||||
MaxDatumSize = 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]
|
|
||||||
|
|
||||||
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
|
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
|
||||||
PcdCName,
|
PcdCName,
|
||||||
|
Reference in New Issue
Block a user