diff options
author | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-10-06 12:34:49 +0300 |
---|---|---|
committer | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-10-06 12:34:49 +0300 |
commit | 8462998a86033277557a49b85f9720e21ae70dcb (patch) | |
tree | 7300980314b0225a70c8d6f8076f3624e4de6e1c /src/org/jetbrains/java/decompiler/main | |
parent | 18a9c2851bb96c3922e60d2f58238aaf388e3e90 (diff) | |
download | fernflower-8462998a86033277557a49b85f9720e21ae70dcb.tar fernflower-8462998a86033277557a49b85f9720e21ae70dcb.tar.gz fernflower-8462998a86033277557a49b85f9720e21ae70dcb.tar.lz fernflower-8462998a86033277557a49b85f9720e21ae70dcb.tar.xz fernflower-8462998a86033277557a49b85f9720e21ae70dcb.zip |
java-decompiler: minor optimization
Diffstat (limited to 'src/org/jetbrains/java/decompiler/main')
-rw-r--r-- | src/org/jetbrains/java/decompiler/main/ClassesProcessor.java | 4 | ||||
-rw-r--r-- | src/org/jetbrains/java/decompiler/main/Fernflower.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java index 88e8688..bab6976 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java @@ -41,6 +41,8 @@ import java.util.Map.Entry; public class ClassesProcessor { + public static final int AVERAGE_CLASS_SIZE = 16 * 1024; + private Map<String, ClassNode> mapRootClasses = new HashMap<String, ClassNode>(); public ClassesProcessor(StructContext context) { @@ -258,7 +260,7 @@ public class ClassesProcessor { new NestedMemberAccess().propagateMemberAccess(root); - StringBuilder classBuffer = new StringBuilder(); + StringBuilder classBuffer = new StringBuilder(AVERAGE_CLASS_SIZE); new ClassWriter().classToJava(root, classBuffer, 0); String lineSeparator = DecompilerContext.getNewLineSeparator(); diff --git a/src/org/jetbrains/java/decompiler/main/Fernflower.java b/src/org/jetbrains/java/decompiler/main/Fernflower.java index 62b8ee4..324a394 100644 --- a/src/org/jetbrains/java/decompiler/main/Fernflower.java +++ b/src/org/jetbrains/java/decompiler/main/Fernflower.java @@ -82,7 +82,7 @@ public class Fernflower implements IDecompiledData { @Override public String getClassContent(StructClass cl) { try { - StringBuilder buffer = new StringBuilder(); + StringBuilder buffer = new StringBuilder(ClassesProcessor.AVERAGE_CLASS_SIZE); classesProcessor.writeClass(cl, buffer); return buffer.toString(); } |