diff --git a/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java b/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java index c865ede3..af89c423 100644 --- a/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java +++ b/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java @@ -195,13 +195,11 @@ public class LacertaVcsImpl implements LacertaVcs { } private ArrayList getLogInRevs(ArrayList vcsRevEntities){ - ArrayList vcsLogEntities = new ArrayList<>(); + List logIds = new ArrayList<>(); vcsRevEntities.forEach(vcsRevEntity -> { - List logIds = new ArrayList<>(vcsRevEntity.logIds); - vcsLogEntities.addAll(database.vcsLogDao().findByIds(logIds)); + logIds.addAll(vcsRevEntity.logIds); }); - - return vcsLogEntities; + return new ArrayList<>(database.vcsLogDao().findByIds(logIds)); } private ArrayList getLogInRev(VcsRevEntity revEntity) {