From ca38320d43588fa74f35cae65ed3b3b072b8d924 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 1 Nov 2012 08:49:14 -0500 Subject: [PATCH] Simplify ATNConfigSet.toArray --- .../Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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