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/AutoGen/InfSectionParser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/InfSectionParser.py') diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py b/BaseTools/Source/Python/AutoGen/InfSectionParser.py index cdc9e5e8a8..cf4e76159e 100644 --- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py +++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py @@ -1,7 +1,7 @@ ## @file # Parser a Inf file and Get specify section data. # -# Copyright (c) 2007 - 2012, 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 # which accompanies this distribution. The full text of the license may be found at @@ -70,7 +70,7 @@ class InfSectionParser(): if not self._FileSectionDataList: return UserExtensionTianoCore for SectionDataDict in self._FileSectionDataList: - for key in SectionDataDict.keys(): + for key in SectionDataDict: if key.lower().startswith("[userextensions") and key.lower().find('.tianocore.') > -1: SectionLine = key.lstrip(TAB_SECTION_START).rstrip(TAB_SECTION_END) SubSectionList = [SectionLine] @@ -89,7 +89,7 @@ class InfSectionParser(): if not self._FileSectionDataList: return DepexExpresionList for SectionDataDict in self._FileSectionDataList: - for key in SectionDataDict.keys(): + for key in SectionDataDict: if key.lower() == "[depex]" or key.lower().startswith("[depex."): SectionLine = key.lstrip(TAB_SECTION_START).rstrip(TAB_SECTION_END) SubSectionList = [SectionLine] -- cgit v1.2.3