From c599af6c9aa1f033f33c6492928d61a74dd32d3d Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 29 Jan 2026 22:27:25 +0100 Subject: [PATCH] use mod to be able to access the last index with -1 conveniently --- .../src/commonMain/kotlin/app/revanced/patcher/Matching.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt b/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt index 33b4bd2..cf2bf75 100644 --- a/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt +++ b/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt @@ -1186,12 +1186,12 @@ open class Match( context(_: BytecodePatchContext) operator fun component3() = immutableClassDef - operator fun get(index: Int) = indices[0][index] + operator fun get(index: Int) = indices.first().let { first -> first[index.mod(first.size)] } operator fun get( matcherIndex: Int, index: Int, - ) = indices[matcherIndex][index] + ) = indices[matcherIndex.mod(indices[0].size)].let { indices -> indices[index.mod(indices.size)] } } context(context: BytecodePatchContext)