Menu

#3 String concatination outside stringbuffer append

open
nobody
None
5
2006-12-21
2006-12-21
No

Why use a string buffer, if you are concatenating in the loop, before appending

Index: gov/nasa/jpf/jvm/JVM.java

--- gov/nasa/jpf/jvm/JVM.java (revision 210)
+++ gov/nasa/jpf/jvm/JVM.java (working copy)
@@ -944,7 +944,8 @@
StringBuffer indent = new StringBuffer();
int i;
for (i = 0;i<=path.size();i++) {
- indent.append("|" + i);
+ indent.append('|');
+ indent.append(i);
}
System.out.println(indent + "|" +s);
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.