chore: simplify OwnersIncludeFilter (don't construct owner list twice)

This commit is contained in:
Pierre Maurice Schwang 2025-02-22 21:31:02 +01:00
parent 424806c5f4
commit d9a46635fd
No known key found for this signature in database
GPG Key ID: 37E613079F3E5BB9

View File

@ -23,17 +23,11 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
class OwnersIncludeFilter implements PlotFilter {
private final UUID owner;
OwnersIncludeFilter(final @NonNull UUID owner) {
this.owner = owner;
}
record OwnersIncludeFilter(UUID owner) implements PlotFilter {
@Override
public boolean accepts(final @NonNull Plot plot) {
return plot.isBasePlot() && plot.getOwners().size() > 0 && plot.getOwners().contains(owner);
return plot.isBasePlot() && plot.isOwner(owner);
}
}