mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Cache regex permissions when they get processed
This commit is contained in:
parent
ced3e6959c
commit
a1afc70bcb
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user