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<>();
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;
}
}