Change varargs to list<T> for type safety
Change-Id: I6890b35e332d5ac4ac5831fc384efc55a8ba3c02
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/peepholes/PeepholeHelper.java b/src/main/java/com/android/tools/r8/ir/optimize/peepholes/PeepholeHelper.java
index 55078e3..fb33451 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/peepholes/PeepholeHelper.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/peepholes/PeepholeHelper.java
@@ -6,15 +6,16 @@
import com.android.tools.r8.ir.code.Instruction;
import com.android.tools.r8.ir.code.InstructionListIterator;
+import java.util.List;
import java.util.function.Predicate;
public class PeepholeHelper {
public static class PeepholeLayout {
private Instruction[] instructions;
- private Predicate<Instruction>[] predicates;
+ private List<Predicate<Instruction>> predicates;
- public PeepholeLayout(Instruction[] instructions, Predicate<Instruction>... predicates) {
+ public PeepholeLayout(Instruction[] instructions, List<Predicate<Instruction>> predicates) {
this.instructions = instructions;
this.predicates = predicates;
}
@@ -41,8 +42,8 @@
}
}
- public static PeepholeLayout getLayout(Predicate<Instruction>... predicates) {
- Instruction[] arr = new Instruction[predicates.length];
+ public static PeepholeLayout getLayout(List<Predicate<Instruction>> predicates) {
+ Instruction[] arr = new Instruction[predicates.size()];
return new PeepholeLayout(arr, predicates);
}