mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-08 11:50:36 +01:00
Slightly optimize viewable stream
This commit is contained in:
parent
ab2fee2bac
commit
056f819cc8
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user