Use LinkedList for constantPaths

This commit is contained in:
Timo Westkämper 2014-10-12 19:41:20 +03:00
parent 13511012e9
commit 10e7f5d5ea

View File

@ -45,7 +45,7 @@ public class SQLSerializer extends SerializerBase<SQLSerializer> {
private static final String COMMA = ", ";
private final List<Path<?>> constantPaths = new ArrayList<Path<?>>();
private final LinkedList<Path<?>> constantPaths = new LinkedList<Path<?>>();
private final List<Object> constants = new ArrayList<Object>();
@ -746,7 +746,7 @@ public class SQLSerializer extends SerializerBase<SQLSerializer> {
append(")");
int size = ((Collection) constant).size() - 1;
Path<?> lastPath = constantPaths.isEmpty() ? null : constantPaths.get(constantPaths.size() - 1);
Path<?> lastPath = constantPaths.peekLast();
for (int i = 0; i < size; i++) {
constantPaths.add(lastPath);
}