From bf9e636605188e291d33ab694ff1c5926b6f0800 Mon Sep 17 00:00:00 2001 From: BobCF Date: Thu, 8 Nov 2018 14:03:38 +0800 Subject: BaseTools: Customize deepcopy function. https://bugzilla.tianocore.org/show_bug.cgi?id=1288 This patch is one of build tool performance improvement series patches. This patch is going to customize the deepcopy function for SkuClass, PcdClassObject and python dictionary. python deepcopy copy everything of a object, but for our current usage we just need to copy the data we care about recursively. By implementing __deepcopy__ for SkuClass, PcdClassObject, we can customize deepcopy function for them. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: BobCF Cc: Liming Gao Cc: Jaben Carsey Reviewed-by: Jaben Carsey Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/Expression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/Common/Expression.py') diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index a5f085d7fb..19ea13b7fb 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from Common.GlobalData import * from CommonDataClass.Exceptions import BadExpression from CommonDataClass.Exceptions import WrnExpression -from .Misc import GuidStringToGuidStructureString, ParseFieldValue +from .Misc import GuidStringToGuidStructureString, ParseFieldValue,CopyDict import Common.EdkLogger as EdkLogger import copy from Common.DataType import * @@ -355,7 +355,7 @@ class ValueExpression(BaseExpression): # # The symbol table including PCD and macro mapping # - self._Symb = copy.deepcopy(SymbolTable) + self._Symb = CopyDict(SymbolTable) self._Symb.update(self.LogicalOperators) self._Idx = 0 self._Len = len(self._Expr) -- cgit v1.2.3