forked from jasder/antlr
Simplify ATNConfigSet.toArray
This commit is contained in:
parent
5a519b9222
commit
ca38320d43
|
@ -463,17 +463,12 @@ public class ATNConfigSet implements Set<ATNConfig> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object[] toArray() {
|
public Object[] toArray() {
|
||||||
ATNConfig[] configs = new ATNConfig[configLookup.size()];
|
return configLookup.toArray();
|
||||||
int i = 0;
|
|
||||||
for (ATNConfig c : configLookup) configs[i++] = c;
|
|
||||||
return configs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T[] toArray(T[] a) {
|
public <T> T[] toArray(T[] a) {
|
||||||
int i = 0;
|
return configLookup.toArray(a);
|
||||||
for (ATNConfig c : configLookup) a[i++] = (T)c;
|
|
||||||
return a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue