mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-30 06:31:02 +00:00
use mod to be able to access the last index with -1 conveniently
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user