mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-03-02 11:31:13 +01:00
Small optimization to processExportedPermissions
This commit is contained in:
parent
bd6d3ab7c0
commit
426c8565fd
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
package me.lucko.luckperms.common.model;
|
package me.lucko.luckperms.common.model;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
@ -272,14 +271,6 @@ public abstract class PermissionHolder {
|
|||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<InheritanceNode> getOwnInheritanceNodes(QueryOptions queryOptions) {
|
|
||||||
List<InheritanceNode> nodes = new ArrayList<>();
|
|
||||||
for (DataType dataType : queryOrder(queryOptions)) {
|
|
||||||
getData(dataType).copyInheritanceNodesTo(nodes, queryOptions);
|
|
||||||
}
|
|
||||||
return nodes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public <T extends Node> List<T> getOwnNodes(NodeType<T> type, QueryOptions queryOptions) {
|
public <T extends Node> List<T> getOwnNodes(NodeType<T> type, QueryOptions queryOptions) {
|
||||||
List<T> nodes = new ArrayList<>();
|
List<T> nodes = new ArrayList<>();
|
||||||
for (DataType dataType : queryOrder(queryOptions)) {
|
for (DataType dataType : queryOrder(queryOptions)) {
|
||||||
@ -288,6 +279,14 @@ public abstract class PermissionHolder {
|
|||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<InheritanceNode> getOwnInheritanceNodes(QueryOptions queryOptions) {
|
||||||
|
List<InheritanceNode> nodes = new ArrayList<>();
|
||||||
|
for (DataType dataType : queryOrder(queryOptions)) {
|
||||||
|
getData(dataType).copyInheritanceNodesTo(nodes, queryOptions);
|
||||||
|
}
|
||||||
|
return nodes;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Node> resolveInheritedNodes(QueryOptions queryOptions) {
|
public List<Node> resolveInheritedNodes(QueryOptions queryOptions) {
|
||||||
if (!queryOptions.flag(Flag.RESOLVE_INHERITANCE)) {
|
if (!queryOptions.flag(Flag.RESOLVE_INHERITANCE)) {
|
||||||
return getOwnNodes(queryOptions);
|
return getOwnNodes(queryOptions);
|
||||||
@ -301,7 +300,6 @@ public abstract class PermissionHolder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nodes;
|
return nodes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedSet<Node> resolveInheritedNodesSorted(QueryOptions queryOptions) {
|
public SortedSet<Node> resolveInheritedNodesSorted(QueryOptions queryOptions) {
|
||||||
@ -365,7 +363,7 @@ public abstract class PermissionHolder {
|
|||||||
return processExportedPermissions(entries, convertToLowercase, resolveShorthand);
|
return processExportedPermissions(entries, convertToLowercase, resolveShorthand);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ImmutableMap<String, Boolean> processExportedPermissions(List<Node> entries, boolean convertToLowercase, boolean resolveShorthand) {
|
private static Map<String, Boolean> processExportedPermissions(List<Node> entries, boolean convertToLowercase, boolean resolveShorthand) {
|
||||||
Map<String, Boolean> map = new HashMap<>(entries.size());
|
Map<String, Boolean> map = new HashMap<>(entries.size());
|
||||||
for (Node node : entries) {
|
for (Node node : entries) {
|
||||||
if (convertToLowercase) {
|
if (convertToLowercase) {
|
||||||
@ -388,7 +386,7 @@ public abstract class PermissionHolder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ImmutableMap.copyOf(map);
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MetaAccumulator accumulateMeta(QueryOptions queryOptions) {
|
public MetaAccumulator accumulateMeta(QueryOptions queryOptions) {
|
||||||
|
Loading…
Reference in New Issue
Block a user