1
0
mirror of https://github.com/etesync/android synced 2025-01-11 00:01:12 +00:00

JournalModel: don't convert to list when getting collections.

Just use the iterator we get back already.
This commit is contained in:
Tom Hacohen 2017-04-20 14:01:28 +01:00
parent da87d14ae9
commit 190ec89c2c

View File

@ -54,8 +54,7 @@ public class JournalModel {
public static List<CollectionInfo> getCollections(EntityDataStore<Persistable> data, long service) {
List<CollectionInfo> ret = new LinkedList<>();
List<JournalEntity> journals = data.select(JournalEntity.class).where(JournalEntity.SERVICE.eq(service).and(JournalEntity.DELETED.eq(false))).get().toList();
for (JournalEntity journal : journals) {
for (JournalEntity journal : data.select(JournalEntity.class).where(JournalEntity.SERVICE.eq(service).and(JournalEntity.DELETED.eq(false))).get()) {
// FIXME: For some reason this isn't always being called, manually do it here.
journal.afterLoad();
ret.add(journal.getInfo());