mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-06 23:24:26 +02:00
refactor: Simplify method implementation
This commit is contained in:
parent
e2ca50729d
commit
15b38fc841
@ -123,7 +123,7 @@ abstract class MethodFingerprint(
|
|||||||
*/
|
*/
|
||||||
fun resolve(context: BytecodeContext, forClass: ClassDef): Boolean {
|
fun resolve(context: BytecodeContext, forClass: ClassDef): Boolean {
|
||||||
for (method in forClass.methods)
|
for (method in forClass.methods)
|
||||||
if (this.resolve(context, method, forClass))
|
if (resolve(context, method, forClass))
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -397,11 +397,11 @@ abstract class MethodFingerprint(
|
|||||||
* @param context The [BytecodeContext] to host proxies.
|
* @param context The [BytecodeContext] to host proxies.
|
||||||
* @return True if the resolution was successful, false otherwise.
|
* @return True if the resolution was successful, false otherwise.
|
||||||
*/
|
*/
|
||||||
fun Iterable<MethodFingerprint>.resolve(context: BytecodeContext, classes: Iterable<ClassDef>) {
|
fun Iterable<MethodFingerprint>.resolve(context: BytecodeContext, classes: Iterable<ClassDef>) =
|
||||||
for (fingerprint in this) // For each fingerprint...
|
forEach { fingerprint ->
|
||||||
classes@ for (classDef in classes) // ...search through all classes for the MethodFingerprint
|
for (classDef in classes) {
|
||||||
if (fingerprint.resolve(context, classDef))
|
if (fingerprint.resolve(context, classDef)) break
|
||||||
break@classes // ...if the resolution succeeded, continue with the next MethodFingerprint.
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun MethodFingerprintResult.MethodFingerprintScanResult.PatternScanResult.createWarnings(
|
private fun MethodFingerprintResult.MethodFingerprintScanResult.PatternScanResult.createWarnings(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user