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/GenFds/CapsuleData.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/CapsuleData.py') diff --git a/BaseTools/Source/Python/GenFds/CapsuleData.py b/BaseTools/Source/Python/GenFds/CapsuleData.py index 5b806d9e44..b376d6b2e9 100644 --- a/BaseTools/Source/Python/GenFds/CapsuleData.py +++ b/BaseTools/Source/Python/GenFds/CapsuleData.py @@ -1,7 +1,7 @@ ## @file # generate capsule # -# Copyright (c) 2007-2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2007-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 @@ -80,8 +80,8 @@ class CapsuleFv (CapsuleData): # def GenCapsuleSubItem(self): if self.FvName.find('.fv') == -1: - if self.FvName.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys(): - FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName.upper()) + if self.FvName.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict: + FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[self.FvName.upper()] FdBuffer = StringIO.StringIO('') FvObj.CapsuleName = self.CapsuleName FvFile = FvObj.AddToBuffer(FdBuffer) @@ -112,8 +112,8 @@ class CapsuleFd (CapsuleData): # def GenCapsuleSubItem(self): if self.FdName.find('.fd') == -1: - if self.FdName.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys(): - FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.FdName.upper()) + if self.FdName.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict: + FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[self.FdName.upper()] FdFile = FdObj.GenFd() return FdFile else: -- cgit v1.2.3