From 35cb5b81dcbec1c03691afb91265234aa2ed6d82 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 29 Aug 2016 16:28:36 +0100 Subject: [PATCH] hopefully fix server stopped responding error with SkipListSet --- .../java/me/lucko/luckperms/core/PermissionHolder.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java index c94ac6a4f..fc4282179 100644 --- a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java @@ -39,7 +39,6 @@ import me.lucko.luckperms.groups.Group; import java.util.*; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentSkipListSet; import java.util.stream.Collectors; /** @@ -139,8 +138,7 @@ public abstract class PermissionHolder { * @return a set of nodes */ public SortedSet getAllNodes(List excludedGroups) { - SortedSet all = new ConcurrentSkipListSet<>(PRIORITY_COMPARATOR); - all.addAll(getPermissions()); + SortedSet all = getPermissions(); if (excludedGroups == null) { excludedGroups = new ArrayList<>(); @@ -536,6 +534,10 @@ public abstract class PermissionHolder { @Override public int compare(Node o1, Node o2) { + if (o1.equals(o2)) { + return 0; + } + if (o1.isOverride() != o2.isOverride()) { return o1.isOverride() ? 1 : -1; }