diff options
author | zaaarf <zaaarf@proton.me> | 2023-02-07 17:42:53 +0100 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-02-07 17:42:53 +0100 |
commit | de8da3abda70c216e4c282a0977364169ab6878d (patch) | |
tree | f0c22dd58a88dcd3b41887913a8b87111f880790 /src/main/java/ftbsc/lll/tools/InsnSequence.java | |
parent | 86a40645d2803e4ad183968ca782c29e1ef9bb4e (diff) |
feat: written stacktools
Diffstat (limited to 'src/main/java/ftbsc/lll/tools/InsnSequence.java')
-rw-r--r-- | src/main/java/ftbsc/lll/tools/InsnSequence.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java index 4afd626..1e667f5 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java @@ -8,7 +8,7 @@ import java.util.Objects; /** * Represents a sequence of instructions contained within two given nodes. - * Extends InsnList, but provides additional flexibility. + * Extends InsnList, but provides additional flexibility and features. */ public class InsnSequence extends InsnList { /** @@ -55,6 +55,16 @@ public class InsnSequence extends InsnList { */ public void add(AbstractInsnNode... nodes) { for(AbstractInsnNode node : nodes) + this.add(node); + } + + /** + * Wraps InsnList's add() to ignore null values. + * @param node to add + */ + @Override + public void add(AbstractInsnNode node) { + if(node != null) super.add(node); } |