Remove more declared method filtering for optimization

Same logic that was applied in #1169
This commit is contained in:
Tyler Benson 2020-01-13 12:52:41 -08:00
parent 3eecb03fe2
commit 5fe26f004b
1 changed files with 4 additions and 6 deletions

View File

@ -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;
} }
} }
@ -349,9 +348,8 @@ public class ByteBuddyElementMatchers {
for (final TypeDefinition type : interfaces) { for (final TypeDefinition type : interfaces) {
if (!checkedInterfaces.contains(type)) { if (!checkedInterfaces.contains(type)) {
checkedInterfaces.add(type); checkedInterfaces.add(type);
for (final MethodDescription methodDescription : for (final MethodDescription methodDescription : type.getDeclaredMethods()) {
type.getDeclaredMethods().filter(signatureMatcher)) { if (signatureMatcher.matches(methodDescription) && matcher.matches(methodDescription)) {
if (matcher.matches(methodDescription)) {
return true; return true;
} }
} }