mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-01 13:44:25 +02:00
perf: Use a hash set for fast lookup
This commit is contained in:
parent
db5b0ed7be
commit
f1de9b39ef
@ -10,7 +10,7 @@ internal object AnnotationExtensions {
|
|||||||
fun <T : Annotation> Class<*>.findAnnotationRecursively(targetAnnotation: Class<T>): T? {
|
fun <T : Annotation> Class<*>.findAnnotationRecursively(targetAnnotation: Class<T>): T? {
|
||||||
fun <T : Annotation> Class<*>.findAnnotationRecursively(
|
fun <T : Annotation> Class<*>.findAnnotationRecursively(
|
||||||
targetAnnotation: Class<T>,
|
targetAnnotation: Class<T>,
|
||||||
searchedAnnotations: MutableSet<Annotation>,
|
searchedAnnotations: HashSet<Annotation>,
|
||||||
): T? {
|
): T? {
|
||||||
val found = this.annotations.firstOrNull { it.annotationClass.java.name == targetAnnotation.name }
|
val found = this.annotations.firstOrNull { it.annotationClass.java.name == targetAnnotation.name }
|
||||||
|
|
||||||
@ -30,6 +30,6 @@ internal object AnnotationExtensions {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.findAnnotationRecursively(targetAnnotation, mutableSetOf())
|
return this.findAnnotationRecursively(targetAnnotation, hashSetOf())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user