]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: dont make temporary dict
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Thu, 5 Apr 2018 14:00:24 +0000 (22:00 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 9 Apr 2018 06:02:57 +0000 (14:02 +0800)
just make the key list directly

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/Common/Misc.py

index 5e9a104305c2965b324c93a4e941f03443cbef4e..23c1a4a0b236ec9e9068499e451045de18def852 100644 (file)
@@ -631,7 +631,7 @@ def GuidValue(CName, PackageList, Inffile = None):
         GuidKeys = P.Guids.keys()\r
         if Inffile and P._PrivateGuids:\r
             if not Inffile.startswith(P.MetaFile.Dir):\r
-                GuidKeys = (dict.fromkeys(x for x in P.Guids if x not in P._PrivateGuids)).keys()\r
+                GuidKeys = [x for x in P.Guids if x not in P._PrivateGuids]\r
         if CName in GuidKeys:\r
             return P.Guids[CName]\r
     return None\r
@@ -650,7 +650,7 @@ def ProtocolValue(CName, PackageList, Inffile = None):
         ProtocolKeys = P.Protocols.keys()\r
         if Inffile and P._PrivateProtocols:\r
             if not Inffile.startswith(P.MetaFile.Dir):\r
-                ProtocolKeys = (dict.fromkeys(x for x in P.Protocols if x not in P._PrivateProtocols)).keys()\r
+                ProtocolKeys = [x for x in P.Protocols if x not in P._PrivateProtocols]\r
         if CName in ProtocolKeys:\r
             return P.Protocols[CName]\r
     return None\r
@@ -669,7 +669,7 @@ def PpiValue(CName, PackageList, Inffile = None):
         PpiKeys = P.Ppis.keys()\r
         if Inffile and P._PrivatePpis:\r
             if not Inffile.startswith(P.MetaFile.Dir):\r
-                PpiKeys = (dict.fromkeys(x for x in P.Ppis if x not in P._PrivatePpis)).keys()\r
+                PpiKeys = [x for x in P.Ppis if x not in P._PrivatePpis]\r
         if CName in PpiKeys:\r
             return P.Ppis[CName]\r
     return None\r