Use static empty context set where appropriate, cache reversed comparator instances
This commit is contained in:
+3
-3
@@ -37,7 +37,7 @@ import com.google.gson.JsonObject;
|
||||
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||
import me.lucko.luckperms.common.contexts.ContextSetComparator;
|
||||
import me.lucko.luckperms.common.contexts.ContextSetJsonSerializer;
|
||||
import me.lucko.luckperms.common.node.NodeWithContextComparator;
|
||||
import me.lucko.luckperms.common.utils.CollationKeyCache;
|
||||
import me.lucko.luckperms.sponge.service.calculated.CalculatedSubjectData;
|
||||
import me.lucko.luckperms.sponge.service.model.LPPermissionService;
|
||||
import me.lucko.luckperms.sponge.service.model.SubjectReference;
|
||||
@@ -195,7 +195,7 @@ public class SubjectStorageModel {
|
||||
|
||||
// sort alphabetically.
|
||||
List<Map.Entry<String, Boolean>> perms = new ArrayList<>(e.getValue().entrySet());
|
||||
perms.sort((o1, o2) -> NodeWithContextComparator.get().compareStrings(o1.getKey(), o2.getKey()));
|
||||
perms.sort(Map.Entry.comparingByKey(CollationKeyCache.comparator()));
|
||||
|
||||
for (Map.Entry<String, Boolean> ent : perms) {
|
||||
data.addProperty(ent.getKey(), ent.getValue());
|
||||
@@ -219,7 +219,7 @@ public class SubjectStorageModel {
|
||||
|
||||
// sort alphabetically.
|
||||
List<Map.Entry<String, String>> opts = new ArrayList<>(e.getValue().entrySet());
|
||||
opts.sort((o1, o2) -> NodeWithContextComparator.get().compareStrings(o1.getKey(), o2.getKey()));
|
||||
opts.sort(Map.Entry.comparingByKey(CollationKeyCache.comparator()));
|
||||
|
||||
for (Map.Entry<String, String> ent : opts) {
|
||||
data.addProperty(ent.getKey(), ent.getValue());
|
||||
|
||||
Reference in New Issue
Block a user