diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java index c0839fe6d..dec431051 100755 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java @@ -463,17 +463,12 @@ public class ATNConfigSet implements Set { @Override public Object[] toArray() { - ATNConfig[] configs = new ATNConfig[configLookup.size()]; - int i = 0; - for (ATNConfig c : configLookup) configs[i++] = c; - return configs; + return configLookup.toArray(); } @Override public T[] toArray(T[] a) { - int i = 0; - for (ATNConfig c : configLookup) a[i++] = (T)c; - return a; + return configLookup.toArray(a); } @Override