From 06a9daf851f6eb793a44c32a7b94e7c9c4768d8c Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 8 Feb 2005 14:45:25 +0000 Subject: [PATCH] Performance optimization - use stringbuffer (found using xray) --- .../aspectj/ajde/internal/LstBuildConfigFileUpdater.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java index 443ef41dc..0ef831aad 100644 --- a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java +++ b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java @@ -185,12 +185,13 @@ class LstBuildConfigFileUpdater { */ public void writeConfigFile(String filePath, List fileContents) { Set contentsSet = new TreeSet(fileContents); - String fileContentsString = ""; + StringBuffer fileContentsSB = new StringBuffer(); Iterator it = contentsSet.iterator(); while (it.hasNext()) { - fileContentsString += it.next().toString() + "\n"; + fileContentsSB.append(it.next().toString()); + fileContentsSB.append("\n"); } - writeFile(fileContentsString, filePath); + writeFile(fileContentsSB.toString(), filePath); } private void writeFile(String contents, String filePath) { -- 2.39.5