BaseTools: Optimize string concatenation

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 use join function instead of
string += string2 statement.

Current code use string += string2 in a loop to combine
a string. while creating a string list in a loop and using
"".join(stringlist) after the loop will be much faster.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: BobCF <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
BobCF
2018-11-08 18:16:25 +08:00
parent 2f818ed0fb
commit 4e37570739
4 changed files with 44 additions and 31 deletions

View File

@ -614,7 +614,9 @@ class InfBuildData(ModuleBuildClassObject):
Instance = Record[1]
if Instance:
Instance = NormPath(Instance, self._Macros)
RetVal[Lib] = Instance
RetVal[Lib] = Instance
else:
RetVal[Lib] = None
return RetVal
## Retrieve library names (for Edk.x style of modules)