Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
794 B
30 lines
794 B
5 years ago
|
package dev.openrs2.asm;
|
||
|
|
||
|
import org.objectweb.asm.tree.AbstractInsnNode;
|
||
|
|
||
|
public final class InsnNodeUtils {
|
||
|
public static AbstractInsnNode nextReal(AbstractInsnNode insn) {
|
||
|
while ((insn = insn.getNext()) != null && insn.getOpcode() == -1);
|
||
|
return insn;
|
||
|
}
|
||
|
|
||
|
public static AbstractInsnNode previousReal(AbstractInsnNode insn) {
|
||
|
while ((insn = insn.getPrevious()) != null && insn.getOpcode() == -1);
|
||
|
return insn;
|
||
|
}
|
||
|
|
||
|
public static AbstractInsnNode nextVirtual(AbstractInsnNode insn) {
|
||
|
while ((insn = insn.getNext()) != null && insn.getOpcode() != -1);
|
||
|
return insn;
|
||
|
}
|
||
|
|
||
|
public static AbstractInsnNode previousVirtual(AbstractInsnNode insn) {
|
||
|
while ((insn = insn.getPrevious()) != null && insn.getOpcode() != -1);
|
||
|
return insn;
|
||
|
}
|
||
|
|
||
|
private InsnNodeUtils() {
|
||
|
/* empty */
|
||
|
}
|
||
|
}
|