Reverse the checking and only assign once to each variable.
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <[email protected]>
---
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
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel