BaseTools: Remove Duplicate sets of SkuName and SkuId from allskuset

Currently when the platform has many SKUs then allskuset will be having
so many duplicate. and while parsing the allskuset will take longer
time while assigning Pcd.SkuInfoList.
This patch is to eliminate those duplicate entries to reduce the
build time

Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Ashraf Ali S 2023-12-25 07:27:52 -08:00 committed by mergify[bot]
parent 8f316e99ec
commit e32b58ab5a
1 changed files with 2 additions and 0 deletions

View File

@ -707,6 +707,8 @@ class PlatformAutoGen(AutoGen):
self._DynamicPcdList.extend(list(OtherPcdArray))
self._DynamicPcdList.sort()
allskuset = [(SkuName, Sku.SkuId) for pcd in self._DynamicPcdList for (SkuName, Sku) in pcd.SkuInfoList.items()]
# Remove duplicate sets in the list
allskuset = list(set(allskuset))
for pcd in self._DynamicPcdList:
if len(pcd.SkuInfoList) == 1:
for (SkuName, SkuId) in allskuset: