Don't need to collect mismatches in the critical path

This commit is contained in:
Brian Devins-Suresh 2020-02-25 09:36:00 -05:00
parent 5ebc13cafa
commit 3b78d4593f
1 changed files with 4 additions and 7 deletions

View File

@ -56,20 +56,17 @@ public class ReferenceMatcher implements WeakMap.ValueSupplier<ClassLoader, Bool
@Override
public Boolean get(final ClassLoader loader) {
final List<Mismatch> mismatches = new ArrayList<>();
for (final Reference reference : references) {
if (mismatches.size() > 0) {
return false;
}
// Don't reference-check helper classes.
// They will be injected by the instrumentation's HelperInjector.
if (!helperClassNames.contains(reference.getClassName())) {
mismatches.addAll(checkMatch(reference, loader));
if (!checkMatch(reference, loader).isEmpty()) {
return false;
}
}
}
return mismatches.size() == 0;
return true;
}
/**