summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/TargetTool
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-17 22:40:15 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-04-18 22:15:36 +0800
commit9eb87141eca12b1f15afa4b769af04d1395891c6 (patch)
tree82ac481092b68ea3684f94bf7dc90c3c584aea52 /BaseTools/Source/Python/TargetTool
parent55c84777ee638be8735a5c421941e7eb71633bdf (diff)
downloadedk2-9eb87141eca12b1f15afa4b769af04d1395891c6.tar.gz
edk2-9eb87141eca12b1f15afa4b769af04d1395891c6.tar.bz2
edk2-9eb87141eca12b1f15afa4b769af04d1395891c6.zip
BaseTools: refactor and remove un-needed use of .keys() on dictionaries
sometimes just delete it. sometimes the loop needed .values() instead Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/TargetTool')
-rw-r--r--BaseTools/Source/Python/TargetTool/TargetTool.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/Source/Python/TargetTool/TargetTool.py
index 143b53ec35..ecac316b7a 100644
--- a/BaseTools/Source/Python/TargetTool/TargetTool.py
+++ b/BaseTools/Source/Python/TargetTool/TargetTool.py
@@ -1,7 +1,7 @@
## @file
# Target Tool Parser
#
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -65,7 +65,7 @@ class TargetTool():
LineList = Line.split(KeySplitCharacter,1)
if len(LineList) >= 2:
Key = LineList[0].strip()
- if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():
+ if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary:
if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM or Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF \
or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \
or Key == TAB_TAT_DEFINES_ACTIVE_MODULE:
@@ -105,7 +105,7 @@ class TargetTool():
LineList = Line.split(KeySplitCharacter,1)
if len(LineList) >= 2:
Key = LineList[0].strip()
- if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():
+ if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary:
if Key not in existKeys:
existKeys.append(Key)
else:
@@ -118,7 +118,7 @@ class TargetTool():
if ret is not None:
Line = ret
fw.write(Line)
- for key in self.TargetTxtDictionary.keys():
+ for key in self.TargetTxtDictionary:
if key not in existKeys:
print "Warning: %s does not exist in original configuration file" % key
Line = GetConfigureKeyValue(self, key)