mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-08 18:46:12 +00:00
Since List<AVM2Instruction> code is frequently accessed by position, it's better to use an ArrayList instead of a LinkedList. Introduced method compact() to reduce memory usage.
This commit is contained in:
@@ -60,7 +60,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
public class AVM2Code {
|
||||
|
||||
public List<AVM2Instruction> code = new LinkedList<AVM2Instruction>();
|
||||
public ArrayList<AVM2Instruction> code = new ArrayList<AVM2Instruction>();
|
||||
public static boolean DEBUG_REWRITE=false;
|
||||
public static final int OPT_U30 = 0x100;
|
||||
public static final int OPT_U8 = 0x200;
|
||||
@@ -705,6 +705,10 @@ public class AVM2Code {
|
||||
}
|
||||
}
|
||||
|
||||
public void compact() {
|
||||
code.trimToSize();
|
||||
}
|
||||
|
||||
public byte[] getBytes() {
|
||||
return getBytes(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user