From 749ab83e5de960235110d2dbf2089ff5c83cd52e Mon Sep 17 00:00:00 2001 From: MattBDev Date: Fri, 12 Aug 2016 15:04:11 -0400 Subject: [PATCH] Move permission check out of loop See #1307 --- Core/src/main/java/com/plotsquared/listener/WEManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/listener/WEManager.java b/Core/src/main/java/com/plotsquared/listener/WEManager.java index 4a035457d..99f5eae3f 100644 --- a/Core/src/main/java/com/plotsquared/listener/WEManager.java +++ b/Core/src/main/java/com/plotsquared/listener/WEManager.java @@ -48,11 +48,11 @@ public class WEManager { if (area == null) { return regions; } + boolean allowMember = player.hasPermission("plots.worldedit.member"); for (Plot plot : area.getPlots()) { if (!plot.isBasePlot() || (Settings.Done.RESTRICT_BUILDING && (plot.getFlag(Flags.DONE).isPresent()))) { continue; } - boolean allowMember = player.hasPermission("plots.worldedit.member"); if (allowMember && plot.isAdded(uuid) || !allowMember && (plot.isOwner(uuid) || plot.getTrusted().contains(uuid))) { regions.addAll(plot.getRegions()); }