Improved CPU load when spamming invalid remote ship controllers

This commit is contained in:
LemADEC 2021-03-17 12:25:47 +01:00
parent 232b7539f3
commit 0053138638

View file

@ -156,6 +156,9 @@ public class GlobalRegionManager {
@Nullable @Nullable
public static GlobalRegion getByUUID(final EnumGlobalRegionType enumGlobalRegionType, final UUID uuid) { public static GlobalRegion getByUUID(final EnumGlobalRegionType enumGlobalRegionType, final UUID uuid) {
if (uuid == null) {
return null;
}
for (final Integer dimensionId : registry.keySet()) { for (final Integer dimensionId : registry.keySet()) {
final CopyOnWriteArraySet<GlobalRegion> setGlobalRegions = registry.get(dimensionId); final CopyOnWriteArraySet<GlobalRegion> setGlobalRegions = registry.get(dimensionId);
if (setGlobalRegions == null) { if (setGlobalRegions == null) {