Skip to content

Commit cde646f

Browse files
committed
fix: Add missing instructions matching overload
1 parent 507fbf3 commit cde646f

File tree

1 file changed

+9
-5
lines changed
  • patcher/src/commonMain/kotlin/app/revanced/patcher

1 file changed

+9
-5
lines changed

patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -950,25 +950,29 @@ fun MutablePredicateList<Method>.instructions(build: Function<IndexedMatcher<Ins
950950
predicate { implementation { match(instructions) } }
951951
}
952952

953-
fun MutablePredicateList<Method>.instructions(vararg predicates: IndexedMatcherPredicate<Instruction>) =
954-
instructions {
955-
predicates.forEach { +it }
956-
}
957-
958953
context(matchers: MutableList<IndexedMatcher<Instruction>>)
959954
fun MutablePredicateList<Method>.instructions(build: Function<IndexedMatcher<Instruction>>) {
960955
val match = indexedMatcher(build).also(matchers::add)
961956

962957
predicate { implementation { match(instructions) } }
963958
}
964959

960+
fun MutablePredicateList<Method>.instructions(vararg predicates: IndexedMatcherPredicate<Instruction>) =
961+
instructions {
962+
predicates.forEach { +it }
963+
}
964+
965965
context(matchers: MutableList<IndexedMatcher<Instruction>>)
966966
fun MutablePredicateList<Method>.instructions(vararg predicates: IndexedMatcherPredicate<Instruction>) =
967967
instructions { predicates.forEach { +it } }
968968

969969
fun MutablePredicateList<Method>.instructions(vararg predicates: Predicate<Instruction>) =
970970
instructions { predicates.forEach { add { _, _, _ -> it() } } }
971971

972+
context(matchers: MutableList<IndexedMatcher<Instruction>>)
973+
fun MutablePredicateList<Method>.instructions(vararg predicates: Predicate<Instruction>) =
974+
instructions { predicates.forEach { add { _, _, _ -> it() } } }
975+
972976
fun MutablePredicateList<Method>.custom(block: Predicate<Method>) {
973977
predicate { block() }
974978
}

0 commit comments

Comments
 (0)