Optimize HasSuperMethodMatcher logic
Instead of filtering then iterating, just iterate through everything and apply filter inline. This will help avoid allocation for filter iterator and improve if early match is found.
This commit is contained in:
parent
8500dbc2ba
commit
5e8af8439a
|
@ -328,9 +328,8 @@ public class ByteBuddyElementMatchers {
|
||||||
final Set<TypeDefinition> checkedInterfaces = new HashSet<>();
|
final Set<TypeDefinition> checkedInterfaces = new HashSet<>();
|
||||||
|
|
||||||
while (declaringType != null) {
|
while (declaringType != null) {
|
||||||
for (final MethodDescription methodDescription :
|
for (final MethodDescription methodDescription : declaringType.getDeclaredMethods()) {
|
||||||
declaringType.getDeclaredMethods().filter(signatureMatcher)) {
|
if (signatureMatcher.matches(methodDescription) && matcher.matches(methodDescription)) {
|
||||||
if (matcher.matches(methodDescription)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue