From 9045b690b7cf7e96708ca0709c99a2f84beaf177 Mon Sep 17 00:00:00 2001 From: v7878 <46866705+vova7878@users.noreply.github.com> Date: Sun, 4 Feb 2024 17:39:42 +0700 Subject: [PATCH] Add CodeBuilder.commit --- src/main/java/com/v7878/dex/bytecode/CodeBuilder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/v7878/dex/bytecode/CodeBuilder.java b/src/main/java/com/v7878/dex/bytecode/CodeBuilder.java index 74a60bf..6d4a797 100644 --- a/src/main/java/com/v7878/dex/bytecode/CodeBuilder.java +++ b/src/main/java/com/v7878/dex/bytecode/CodeBuilder.java @@ -231,6 +231,11 @@ public CodeBuilder if_(boolean value, Consumer true_branch, return this; } + public CodeBuilder commit(Consumer branch) { + branch.accept(this); + return this; + } + private void format_35c_checks(int arg_count, int arg_reg1, int arg_reg2, int arg_reg3, int arg_reg4, int arg_reg5) { Checks.checkRange(arg_count, 0, 6);