SteamWar/SpigotCore
Archiviert
13
0

Add Breadcrumbs Cache

Dieser Commit ist enthalten in:
Chaoscaot 2021-07-26 19:57:59 +02:00
Ursprung f29309f3ec
Commit 4afc475161

Datei anzeigen

@ -282,6 +282,7 @@ public class SchematicNode {
private boolean schemFormat; private boolean schemFormat;
private int rank; private int rank;
private final boolean isDir; private final boolean isDir;
private Map<Integer, String> brCache = new HashMap<>();
public static List<SchematicNode> filterSchems(int user, Predicate<SchematicNode> filter) { public static List<SchematicNode> filterSchems(int user, Predicate<SchematicNode> filter) {
List<SchematicNode> finalList = new ArrayList<>(); List<SchematicNode> finalList = new ArrayList<>();
@ -401,7 +402,7 @@ public class SchematicNode {
} }
public String generateBreadcrumbs(SteamwarUser user) { public String generateBreadcrumbs(SteamwarUser user) {
return generateBreadcrumbs("/", user); return brCache.computeIfAbsent(user.getId(), integer -> generateBreadcrumbs("/", user));
} }
public String generateBreadcrumbs(String split, SteamwarUser user) { public String generateBreadcrumbs(String split, SteamwarUser user) {