Remove more declared method filtering for optimization
Same logic that was applied in
@@ -328,9 +328,8 @@ public class ByteBuddyElementMatchers {
final Set<TypeDefinition> checkedInterfaces = new HashSet<>();
while (declaringType != null) {
- for (final MethodDescription methodDescription :
- declaringType.getDeclaredMethods().filter(signatureMatcher)) {
- if (matcher.matches(methodDescription)) {
+ for (final MethodDescription methodDescription : declaringType.getDeclaredMethods()) {
+ if (signatureMatcher.matches(methodDescription) && matcher.matches(methodDescription)) {
return true;
}
}
@@ -349,9 +348,8 @@ public class ByteBuddyElementMatchers {
for (final TypeDefinition type : interfaces) {
if (!checkedInterfaces.contains(type)) {
checkedInterfaces.add(type);
- for (final MethodDescription methodDescription :
- type.getDeclaredMethods().filter(signatureMatcher)) {
- if (matcher.matches(methodDescription)) {
+ for (final MethodDescription methodDescription : type.getDeclaredMethods()) {
+ if (signatureMatcher.matches(methodDescription) && matcher.matches(methodDescription)) {
return true;
}
}
