Fast exit when the entity has no viewer

This commit is contained in:
themode 2022-03-01 05:36:33 +01:00
parent ae71c09b4f
commit 5930626dad
1 changed files with 1 additions and 0 deletions

View File

@ -233,6 +233,7 @@ final class EntityView {
Player[] players;
synchronized (mutex) {
var bitSet = viewableOption.bitSet;
if (bitSet.isEmpty()) return Collections.emptyIterator();
players = new Player[bitSet.size()];
int i = 0;
for (IntIterator it = bitSet.intIterator(); it.hasNext(); ) {