Reverse the checking and only assign once to each variable. Cc: Yonghong Zhu <yonghong....@intel.com> Cc: Liming Gao <liming....@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.car...@intel.com> --- BaseTools/Source/Python/Workspace/DscBuildData.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 748452623fd3..e4f5cba156c5 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, -- 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel