mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-13 21:54:05 +00:00
Cache regex permissions when they get processed
This commit is contained in:
2 files changed
+5
-1
No files matched your search
+4
-1
@@ -57,7 +57,10 @@ public class RegexProcessor implements PermissionProcessor {
|
||||
continue;
|
||||
}
|
||||
|
||||
regexPermissions.put(e.getKey().substring(2), e.getValue());
|
||||
String pattern = e.getKey().substring(2);
|
||||
Patterns.compile(pattern); // Cache the lookup for later.
|
||||
|
||||
regexPermissions.put(pattern, e.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public class Patterns {
|
||||
try {
|
||||
return CACHE.get(regex);
|
||||
} catch (UncheckedExecutionException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user