}
public Collection<ShardDataTreeCohort> getAndClearPendingTransactions() {
- Collection<ShardDataTreeCohort> ret = new ArrayList<>(pendingTransactions.size() + pendingCommits.size()
- + pendingFinishCommits.size());
+ Collection<ShardDataTreeCohort> ret = new ArrayList<>(getQueueSize());
for (CommitEntry entry: pendingFinishCommits) {
ret.add(entry.cohort);
return true;
} else {
- newTip = MoreObjects.firstNonNull(e.cohort.getCandidate(), dataTree);
+ newTip = MoreObjects.firstNonNull(e.cohort.getCandidate(), newTip);
}
}