mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-04 06:34:24 +02:00
refactor: lazy initialize implementation field for mutable methods
This commit is contained in:
parent
1ee2e4ba56
commit
bea0cbc550
@ -13,7 +13,7 @@ class MutableMethod(method: Method) : Method, BaseMethodReference() {
|
|||||||
private var returnType = method.returnType
|
private var returnType = method.returnType
|
||||||
|
|
||||||
// Create own mutable MethodImplementation (due to not being able to change members like register count)
|
// Create own mutable MethodImplementation (due to not being able to change members like register count)
|
||||||
private var implementation = method.implementation?.let { MutableMethodImplementation(it) }
|
private val _implementation by lazy { method.implementation?.let { MutableMethodImplementation(it) } }
|
||||||
private val _annotations by lazy { method.annotations.map { annotation -> annotation.toMutable() }.toMutableSet() }
|
private val _annotations by lazy { method.annotations.map { annotation -> annotation.toMutable() }.toMutableSet() }
|
||||||
private val _parameters by lazy { method.parameters.map { parameter -> parameter.toMutable() }.toMutableList() }
|
private val _parameters by lazy { method.parameters.map { parameter -> parameter.toMutable() }.toMutableList() }
|
||||||
private val _parameterTypes by lazy { method.parameterTypes.toMutableList() }
|
private val _parameterTypes by lazy { method.parameterTypes.toMutableList() }
|
||||||
@ -47,7 +47,7 @@ class MutableMethod(method: Method) : Method, BaseMethodReference() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getImplementation(): MutableMethodImplementation? {
|
override fun getImplementation(): MutableMethodImplementation? {
|
||||||
return implementation
|
return _implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user