fix: remove count instead of count + 1 instructions with removeInstructions (#167)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>

BREAKING-CHANGE: This alters the behaviour of the function. Instead of removing `count + 1` instructions, this now removes `count` instructions.
This commit is contained in:
rstular 2023-05-06 13:42:26 +02:00 committed by oSumAtrIX
parent 4ed429d25c
commit 98f8eedecd
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -39,7 +39,7 @@ fun MutableMethodImplementation.replaceInstructions(index: Int, instructions: Li
}
fun MutableMethodImplementation.removeInstructions(index: Int, count: Int) {
for (i in count downTo 0) {
for (i in count - 1 downTo 0) {
this.removeInstruction(index + i)
}
}