Avoid extensive hashing of plots

This commit is contained in:
SirYwell 2022-12-21 16:11:58 +01:00
parent 8d76ec549e
commit 5fd314818f
No known key found for this signature in database

View File

@ -23,9 +23,9 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.List;
import java.util.Set;
class GlobalPlotProvider implements PlotProvider { class GlobalPlotProvider implements PlotProvider {
@ -37,7 +37,7 @@ class GlobalPlotProvider implements PlotProvider {
@Override @Override
public Collection<Plot> getPlots() { public Collection<Plot> getPlots() {
final Set<Plot> plots = new HashSet<>(); final List<Plot> plots = new ArrayList<>();
for (final PlotArea plotArea : this.plotAreaManager.getAllPlotAreas()) { for (final PlotArea plotArea : this.plotAreaManager.getAllPlotAreas()) {
plots.addAll(plotArea.getPlots()); plots.addAll(plotArea.getPlots());
} }