]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/TargetTool/TargetTool.py
BaseTools: refactor and remove un-needed use of .keys() on dictionaries
[mirror_edk2.git] / BaseTools / Source / Python / TargetTool / TargetTool.py
index 143b53ec35efb516647287608910a34de622c5c3..ecac316b7a3adb6451b8e42d5378bf4cd4995b7e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Target Tool Parser\r
 #\r
 ## @file\r
 # Target Tool Parser\r
 #\r
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -65,7 +65,7 @@ class TargetTool():
                 LineList = Line.split(KeySplitCharacter,1)\r
                 if len(LineList) >= 2:\r
                     Key = LineList[0].strip()\r
                 LineList = Line.split(KeySplitCharacter,1)\r
                 if len(LineList) >= 2:\r
                     Key = LineList[0].strip()\r
-                    if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():\r
+                    if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary:\r
                         if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM or Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF \\r
                           or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \\r
                           or Key == TAB_TAT_DEFINES_ACTIVE_MODULE:\r
                         if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM or Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF \\r
                           or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \\r
                           or Key == TAB_TAT_DEFINES_ACTIVE_MODULE:\r
@@ -105,7 +105,7 @@ class TargetTool():
                     LineList = Line.split(KeySplitCharacter,1)\r
                     if len(LineList) >= 2:\r
                         Key = LineList[0].strip()\r
                     LineList = Line.split(KeySplitCharacter,1)\r
                     if len(LineList) >= 2:\r
                         Key = LineList[0].strip()\r
-                        if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():\r
+                        if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary:\r
                             if Key not in existKeys:\r
                                 existKeys.append(Key)\r
                             else:\r
                             if Key not in existKeys:\r
                                 existKeys.append(Key)\r
                             else:\r
@@ -118,7 +118,7 @@ class TargetTool():
                                 if ret is not None:\r
                                     Line = ret\r
                             fw.write(Line)\r
                                 if ret is not None:\r
                                     Line = ret\r
                             fw.write(Line)\r
-            for key in self.TargetTxtDictionary.keys():\r
+            for key in self.TargetTxtDictionary:\r
                 if key not in existKeys:\r
                     print "Warning: %s does not exist in original configuration file" % key\r
                     Line = GetConfigureKeyValue(self, key)\r
                 if key not in existKeys:\r
                     print "Warning: %s does not exist in original configuration file" % key\r
                     Line = GetConfigureKeyValue(self, key)\r