]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/VpdInfoFile.py
BaseTools: refactor and remove un-needed use of .keys() on dictionaries
[mirror_edk2.git] / BaseTools / Source / Python / Common / VpdInfoFile.py
index b1baf06b9ccd40a4f86b14965b271df980afd7b3..5559a88b97f2765fe669c62d2c8641151d7aba75 100644 (file)
@@ -6,7 +6,7 @@
 # is pointed by *_*_*_VPD_TOOL_GUID in conf/tools_def.txt \r
 #\r
 #\r
-# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -107,7 +107,7 @@ class VpdInfoFile:
                 EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,\r
                                 "Invalid max datum size for VPD PCD %s.%s" % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName))\r
             \r
-        if Vpd not in self._VpdArray.keys():\r
+        if Vpd not in self._VpdArray:\r
             #\r
             # If there is no Vpd instance in dict, that imply this offset for a given SKU is a new one \r
             #\r
@@ -180,12 +180,12 @@ class VpdInfoFile:
             if (TokenSpaceName, PcdTokenName) not in self._VpdInfo:\r
                 self._VpdInfo[(TokenSpaceName, PcdTokenName)] = []\r
             self._VpdInfo[(TokenSpaceName, PcdTokenName)].append((SkuId,Offset, Value))\r
-            for VpdObject in self._VpdArray.keys():\r
+            for VpdObject in self._VpdArray:\r
                 VpdObjectTokenCName = VpdObject.TokenCName\r
                 for PcdItem in GlobalData.MixedPcd:\r
                     if (VpdObject.TokenCName, VpdObject.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem]:\r
                         VpdObjectTokenCName = PcdItem[0]\r
-                for sku in VpdObject.SkuInfoList.keys():\r
+                for sku in VpdObject.SkuInfoList:\r
                     if VpdObject.TokenSpaceGuidCName == TokenSpaceName and VpdObjectTokenCName == PcdTokenName.strip() and sku == SkuId:\r
                         if self._VpdArray[VpdObject][sku] == "*":\r
                             if Offset == "*":\r