Skip to content

Commit

Permalink
refactor: Optimize Signature class (#11)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Array<Int> was changed to IntArray. This breaks existing patches.
  • Loading branch information
Sculas authored and oSumAtrIX committed Jun 5, 2022
1 parent 7087230 commit 7faa001
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ data class Signature(
val returns: Type?,
val accessors: Int?,
val parameters: Array<Type>?,
val opcodes: Array<Int>?
val opcodes: IntArray?
)
2 changes: 1 addition & 1 deletion src/test/kotlin/app/revanced/patcher/PatcherTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal class PatcherTest {
Type.VOID_TYPE,
ACC_PUBLIC or ACC_STATIC,
arrayOf(ExtraTypes.ArrayAny),
arrayOf(
intArrayOf(
LDC,
INVOKEVIRTUAL
)
Expand Down

0 comments on commit 7faa001

Please sign in to comment.