From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F2C972034C8CF for ; Fri, 27 Apr 2018 15:33:01 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 15:33:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,336,1520924400"; d="scan'208";a="54252819" Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2018 15:32:59 -0700 From: Jaben Carsey To: edk2-devel@lists.01.org Cc: Liming Gao , Yonghong Zhu Date: Fri, 27 Apr 2018 15:32:31 -0700 Message-Id: <73926a857dd8caa9a4129909cbf8516056d10abb.1524868034.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH v1 17/42] BaseTools: Workspace - refactor a dict X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 22:33:02 -0000 change a dict to a set since we never examine the contents, just the keys. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py index 6ca3cd9da22b..258905e80f25 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -136,7 +136,7 @@ class StructurePcd(PcdClassObject): self.PcdDefineLineNo = 0 self.PkgPath = "" self.DefaultValueFromDec = "" - self.ValueChain = dict() + self.ValueChain = set() self.PcdFieldValueFromComm = collections.OrderedDict() def __repr__(self): return self.TypeName diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 335267ebc576..8ebac8957a1b 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1347,7 +1347,7 @@ class DscBuildData(PlatformBuildClassObject): nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid) stru_pcd.SkuOverrideValues[skuid] = copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({defaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStores} if DefaultStores else {TAB_DEFAULT_STORES_DEFAULT:stru_pcd.DefaultValues}) if not NoDefault: - stru_pcd.ValueChain[(skuid,'')]= (nextskuid,'') + stru_pcd.ValueChain.add(skuid,'') if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for skuid in SkuIds: nextskuid = skuid @@ -1366,7 +1366,7 @@ class DscBuildData(PlatformBuildClassObject): for defaultstoreid in DefaultStores: if defaultstoreid not in stru_pcd.SkuOverrideValues[skuid]: stru_pcd.SkuOverrideValues[skuid][defaultstoreid] = copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstorename]) - stru_pcd.ValueChain[(skuid,defaultstoreid)]= (nextskuid,mindefaultstorename) + stru_pcd.ValueChain.add(skuid,defaultstoreid) S_pcd_set = DscBuildData.OverrideByFdfComm(S_pcd_set) Str_Pcd_Values = self.GenerateByteArrayValue(S_pcd_set) if Str_Pcd_Values: -- 2.16.2.windows.1