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/Common/EdkIIWorkspace.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'BaseTools/Source/Python/Common/EdkIIWorkspace.py') diff --git a/BaseTools/Source/Python/Common/EdkIIWorkspace.py b/BaseTools/Source/Python/Common/EdkIIWorkspace.py index c14b4eb52d..d75b9f8025 100644 --- a/BaseTools/Source/Python/Common/EdkIIWorkspace.py +++ b/BaseTools/Source/Python/Common/EdkIIWorkspace.py @@ -1,7 +1,7 @@ ## @file # This is the base class for applications that operate on an EDK II Workspace # -# Copyright (c) 2007 - 2014, 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 @@ -259,10 +259,7 @@ def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplit except: Lines = [] Keys = Dictionary.keys() - MaxLength = 0 - for Key in Keys: - if len(Key) > MaxLength: - MaxLength = len(Key) + MaxLength = max(map(len,Keys)) Index = 0 for Line in Lines: LineList = Line.split(KeySplitCharacter, 1) -- cgit v1.2.3