Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SuspiciousActivity committed Mar 9, 2021
1 parent a851716 commit 5a5cb64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/me/ByteEdit/decompiler/SingleThreadedExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class SingleThreadedExecutor {
}, "SingleThreadedExecutor");

static {
thread.setPriority(Thread.MAX_PRIORITY);
thread.start();
}

Expand Down
11 changes: 3 additions & 8 deletions src/me/ByteEdit/edit/Assembler.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
public class Assembler {

public static final Pattern SPACE = Pattern.compile(" ");
private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];

public static ClassNode assemble(String input) {
Main.txtByteEditView.removeAllLineHighlights();
Expand Down Expand Up @@ -1488,20 +1489,14 @@ public LabelNode apply(SwitchIntContainer t, LabelNode u) {
}
}
}
Object[] _args = new Object[args.size()];
stage = 0;
for (Object o : args) {
_args[stage] = o;
stage++;
}
return new InvokeDynamicInsnNode(UnicodeUtils.unescape(hsr, sp[0].substring(7)),
UnicodeUtils.unescape(hsr, sp[1].substring(6)),
new Handle(OpcodesReverse.getHandleOpcode(sp[7].substring(6)),
UnicodeUtils.unescape(hsr, sp[4].substring(8)),
UnicodeUtils.unescape(hsr, sp[3].substring(7)),
UnicodeUtils.unescape(hsr, sp[5].substring(7)),
Boolean.parseBoolean(sp[6].substring(14))),
_args);
args.toArray(new Object[args.size()]));
}
case "new": {
return new TypeInsnNode(187, UnicodeUtils.unescape(hsr, split[1]));
Expand Down Expand Up @@ -1565,7 +1560,7 @@ private static Object[] parseFrameList(HugeStringsRev hsr, String str, HashMap<L
ArrayList<Object> list = new ArrayList<>();
String l = str.substring(1, str.length() - 1);
if (l.isEmpty()) {
return new Object[0];
return EMPTY_OBJECT_ARRAY;
} else {
for (String asd : l.split(", ")) {
if (!asd.startsWith("(")) {
Expand Down

0 comments on commit 5a5cb64

Please sign in to comment.