]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/EdkIIWorkspace.py
BaseTools: refactor and remove un-needed use of .keys() on dictionaries
[mirror_edk2.git] / BaseTools / Source / Python / Common / EdkIIWorkspace.py
index c14b4eb52d50f32a9c3e3fbac94de958327b4174..d75b9f8025b3e7ac7ff1f7c3516abef5ade21bb0 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This is the base class for applications that operate on an EDK II Workspace \r
 #\r
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -259,10 +259,7 @@ def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplit
     except:\r
         Lines = []\r
     Keys = Dictionary.keys()\r
-    MaxLength = 0\r
-    for Key in Keys:\r
-        if len(Key) > MaxLength:\r
-            MaxLength = len(Key)\r
+    MaxLength = max(map(len,Keys))\r
     Index = 0\r
     for Line in Lines:\r
         LineList = Line.split(KeySplitCharacter, 1)\r