[Minor] Small memory consumption improvement

This commit is contained in:
Robert von Burg 2017-08-30 16:31:44 +02:00
parent 9801e8e543
commit d2f19dca5d
1 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ public class InMemoryDao<T extends StrolchRootElement> implements StrolchDao<T>
return null;
ArrayDeque<T> list = byType.get(id);
if (list == null)
return new ArrayList<>();
return new ArrayList<>(0);
return new ArrayList<>(list);
}
@ -196,7 +196,7 @@ public class InMemoryDao<T extends StrolchRootElement> implements StrolchDao<T>
}
if (list == null) {
list = new ArrayDeque<>();
list = new ArrayDeque<>(2);
byType.put(element.getId(), list);
}