diff --git a/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/javafeatures/ForEachLoopFilter.java b/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/javafeatures/ForEachLoopFilter.java index 784475400..4ac822315 100644 --- a/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/javafeatures/ForEachLoopFilter.java +++ b/pitest-entry/src/main/java/org/pitest/mutationtest/build/intercept/javafeatures/ForEachLoopFilter.java @@ -191,11 +191,6 @@ private Predicate mutatesIteratorLoopPlumbing() { final int instruction = a.getInstructionIndex(); final MethodTree method = currentClass.method(a.getId().getLocation()).get(); - //performance hack - if (!mightContainForLoop(method.instructions())) { - return false; - } - final AbstractInsnNode mutatedInstruction = method.instruction(instruction); Set toAvoid = cache.computeIfAbsent(method, this::findLoopInstructions); @@ -211,11 +206,6 @@ private Set findLoopInstructions(MethodTree method) { .collect(Collectors.toSet()); } - private boolean mightContainForLoop(List instructions) { - return instructions.stream() - .anyMatch(hasNextMethodCall().or(ARRAYLENGTH).asPredicate()); - } - @Override public void end() { this.currentClass = null;