mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
fix: current must be calculated after increment
This commit is contained in:
parent
ec8115f3ac
commit
5f12bab5df
1 changed files with 2 additions and 2 deletions
|
@ -104,9 +104,9 @@ private fun InsnList.scanFor(pattern: Array<Int>): ScanResult {
|
|||
for (i in 0 until this.size()) {
|
||||
var occurrence = 0
|
||||
while (i + occurrence < this.size()) {
|
||||
val current = i + occurrence
|
||||
if (this[current].opcode != pattern[occurrence]) break
|
||||
if (this[i + occurrence].opcode != pattern[occurrence]) break
|
||||
if (++occurrence >= pattern.size) {
|
||||
val current = i + occurrence
|
||||
return ScanResult(true, current - pattern.size, current)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue