refactor: Optimize Signature class (#11)

BREAKING CHANGE: Array<Int> was changed to IntArray. This breaks existing patches.
This commit is contained in:
Lucaskyy 2022-03-23 20:00:35 +01:00
parent 3ab42a932c
commit 49beec9fc6
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89
3 changed files with 3 additions and 3 deletions

View file

@ -131,7 +131,7 @@ private operator fun ClassNode.component2(): List<MethodNode> {
return this.methods
}
private fun InsnList.scanFor(pattern: Array<Int>): ScanResult {
private fun InsnList.scanFor(pattern: IntArray): ScanResult {
for (i in 0 until this.size()) {
var occurrence = 0
while (i + occurrence < this.size()) {

View file

@ -23,5 +23,5 @@ data class Signature(
val returns: Type?,
val accessors: Int?,
val parameters: Array<Type>?,
val opcodes: Array<Int>?
val opcodes: IntArray?
)

View file

@ -38,7 +38,7 @@ internal class PatcherTest {
Type.VOID_TYPE,
ACC_PUBLIC or ACC_STATIC,
arrayOf(ExtraTypes.ArrayAny),
arrayOf(
intArrayOf(
LDC,
INVOKEVIRTUAL
)