Browse Source

Performance optimization - use stringbuffer (found using xray)

tags/V1_5_0M2
aclement 19 years ago
parent
commit
06a9daf851
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java

+ 4
- 3
ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java View File

@@ -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) {

Loading…
Cancel
Save