Cache regex permissions when they get processed

This commit is contained in:
Luck
2017-01-12 19:45:15 +00:00
Unverified
parent ced3e6959c
commit a1afc70bcb
2 changed files with 5 additions and 1 deletions
@@ -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;
}
}