X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FParsing.py;h=453c2039e3d9a71b4058f70838dfe59b6e6afa4a;hp=d199d1e40d8e0605de8fb8dd886e79908e8e68a6;hb=9eb87141eca12b1f15afa4b769af04d1395891c6;hpb=55c84777ee638be8735a5c421941e7eb71633bdf
diff --git a/BaseTools/Source/Python/Common/Parsing.py b/BaseTools/Source/Python/Common/Parsing.py
index d199d1e40d..453c2039e3 100644
--- a/BaseTools/Source/Python/Common/Parsing.py
+++ b/BaseTools/Source/Python/Common/Parsing.py
@@ -1,7 +1,7 @@
## @file
# This file is used to define common parsing related functions used in parsing INF/DEC/DSC process
#
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 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
@@ -37,16 +37,14 @@ def ParseDefineMacro2(Table, RecordSets, GlobalMacro):
#
# Overrided by Global Macros
#
- for Key in GlobalMacro.keys():
- Macros[Key] = GlobalMacro[Key]
+ Macros.update(GlobalMacro)
#
# Replace the Macros
#
- for Key in RecordSets.keys():
- if RecordSets[Key] != []:
- for Item in RecordSets[Key]:
- Item[0] = ReplaceMacro(Item[0], Macros)
+ for Value in (v for v in RecordSets.values() if v):
+ for Item in Value:
+ Item[0] = ReplaceMacro(Item[0], Macros)
## ParseDefineMacro
#
@@ -79,8 +77,7 @@ def ParseDefineMacro(Table, GlobalMacro):
#
# Overrided by Global Macros
#
- for Key in GlobalMacro.keys():
- Macros[Key] = GlobalMacro[Key]
+ Macros.update(GlobalMacro)
#
# Found all defined macro and replaced