From 9eb87141eca12b1f15afa4b769af04d1395891c6 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Tue, 17 Apr 2018 22:40:15 +0800 Subject: BaseTools: refactor and remove un-needed use of .keys() on dictionaries sometimes just delete it. sometimes the loop needed .values() instead Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/WorkspaceCommon.py') diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py index 17ac3b1054..736ef62534 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -1,7 +1,7 @@ ## @file # Common routines used by workspace # -# Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -63,11 +63,11 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain,additionalPk PcdCName = Pcd[0] PcdTokenName = Pcd[1] if GlobalData.MixedPcd: - for PcdItem in GlobalData.MixedPcd.keys(): + for PcdItem in GlobalData.MixedPcd: if (PcdCName, PcdTokenName) in GlobalData.MixedPcd[PcdItem]: PcdCName = PcdItem[0] break - if (PcdCName, PcdTokenName) not in DecPcds.keys(): + if (PcdCName, PcdTokenName) not in DecPcds: DecPcds[PcdCName, PcdTokenName] = Pkg.Pcds[Pcd] return DecPcds, GuidDict @@ -243,7 +243,7 @@ def _ResolveLibraryReference(Module, Platform): for LibraryName in M.Libraries: Library = Platform.LibraryClasses[LibraryName, ':dummy:'] if Library is None: - for Key in Platform.LibraryClasses.data.keys(): + for Key in Platform.LibraryClasses.data: if LibraryName.upper() == Key.upper(): Library = Platform.LibraryClasses[Key, ':dummy:'] break -- cgit v1.2.3