mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-10 00:54:28 +02:00
refactor: Optimize Signature class (#11)
BREAKING CHANGE: Array<Int> was changed to IntArray. This breaks existing patches.
This commit is contained in:
parent
70872307e3
commit
7faa001406
@ -131,7 +131,7 @@ private operator fun ClassNode.component2(): List<MethodNode> {
|
|||||||
return this.methods
|
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()) {
|
for (i in 0 until this.size()) {
|
||||||
var occurrence = 0
|
var occurrence = 0
|
||||||
while (i + occurrence < this.size()) {
|
while (i + occurrence < this.size()) {
|
||||||
|
@ -23,5 +23,5 @@ data class Signature(
|
|||||||
val returns: Type?,
|
val returns: Type?,
|
||||||
val accessors: Int?,
|
val accessors: Int?,
|
||||||
val parameters: Array<Type>?,
|
val parameters: Array<Type>?,
|
||||||
val opcodes: Array<Int>?
|
val opcodes: IntArray?
|
||||||
)
|
)
|
@ -38,7 +38,7 @@ internal class PatcherTest {
|
|||||||
Type.VOID_TYPE,
|
Type.VOID_TYPE,
|
||||||
ACC_PUBLIC or ACC_STATIC,
|
ACC_PUBLIC or ACC_STATIC,
|
||||||
arrayOf(ExtraTypes.ArrayAny),
|
arrayOf(ExtraTypes.ArrayAny),
|
||||||
arrayOf(
|
intArrayOf(
|
||||||
LDC,
|
LDC,
|
||||||
INVOKEVIRTUAL
|
INVOKEVIRTUAL
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user