mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
fix: remove unnecessary dummy nop instructions (#111)
This commit is contained in:
parent
d2f91a8545
commit
f9bc95f220
1 changed files with 2 additions and 2 deletions
|
@ -139,10 +139,10 @@ fun MutableMethod.addInstructions(index: Int, smali: String, externalLabels: Lis
|
||||||
|
|
||||||
// Add the compiled list of instructions to the method.
|
// Add the compiled list of instructions to the method.
|
||||||
val methodImplementation = this.implementation!!
|
val methodImplementation = this.implementation!!
|
||||||
methodImplementation.addInstructions(index, compiledInstructions)
|
methodImplementation.addInstructions(index, compiledInstructions.subList(0, compiledInstructions.size - externalLabels.size))
|
||||||
|
|
||||||
val methodInstructions = methodImplementation.instructions
|
val methodInstructions = methodImplementation.instructions
|
||||||
methodInstructions.subList(index, index + compiledInstructions.size)
|
methodInstructions.subList(index, index + compiledInstructions.size - externalLabels.size)
|
||||||
.forEachIndexed { compiledInstructionIndex, compiledInstruction ->
|
.forEachIndexed { compiledInstructionIndex, compiledInstruction ->
|
||||||
// If the compiled instruction is not an offset instruction, skip it.
|
// If the compiled instruction is not an offset instruction, skip it.
|
||||||
if (compiledInstruction !is BuilderOffsetInstruction) return@forEachIndexed
|
if (compiledInstruction !is BuilderOffsetInstruction) return@forEachIndexed
|
||||||
|
|
Loading…
Reference in a new issue