Slightly optimize viewable stream

This commit is contained in:
themode 2022-02-13 20:02:06 +01:00
parent ab2fee2bac
commit 056f819cc8

View File

@ -227,11 +227,11 @@ public final class ViewEngine {
Stream<T> sharedInstanceStream = shared.stream().<List<T>>mapMulti((inst, consumer) -> { Stream<T> sharedInstanceStream = shared.stream().<List<T>>mapMulti((inst, consumer) -> {
var ref = inst.getEntityTracker().references(lastPoint, range, target); var ref = inst.getEntityTracker().references(lastPoint, range, target);
ref.forEach(consumer); ref.forEach(consumer);
}).flatMap(Collection::stream); }).flatMap(Collection::stream).distinct();
result = Stream.concat(result, sharedInstanceStream); result = Stream.concat(result, sharedInstanceStream);
} }
} }
return result.distinct(); return result;
} }
} }