INNER CODE UNIT · Kotlin
distance
ReVanced/revanced-patcher · patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt:670
val distance = currentIndex - lastMatchedIndex
setNextIndex(
when {
distance < range.first -> lastMatchedIndex + range.first
distance > range.last -> -1
else -> return@predicate predicate(lastMatchedIndex, currentIndex, setNextIndex)
},
)
false
}
fun <T> after(
range: IntRange = 1..1,
predicate: Predicate<T>,
) = after<T>(range) { _, _, _ -> predicate() }