java-decompiler: optimization (less string buffer allocations on generating text)

This commit is contained in:
Roman Shevchenko
2014-09-04 14:30:28 +04:00
parent f4f9e8be28
commit 1cea85e49a
20 changed files with 835 additions and 1055 deletions

View File

@@ -60,14 +60,18 @@ public class InterpreterUtil {
}
public static String getIndentString(int length) {
String indent = (String)DecompilerContext.getProperty(IFernflowerPreferences.INDENT_STRING);
StringBuilder buf = new StringBuilder();
while (length-- > 0) {
buf.append(indent);
}
appendIndent(buf, length);
return buf.toString();
}
public static void appendIndent(StringBuilder buffer, int length) {
String indent = (String)DecompilerContext.getProperty(IFernflowerPreferences.INDENT_STRING);
while (length-- > 0) {
buffer.append(indent);
}
}
public static boolean equalSets(Collection<?> c1, Collection<?> c2) {
if (c1 == null) {
return c2 == null;