mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
Speed up permission recalculation.
Based on ideas in PR #102, but rewritten for correctness.
This commit is contained in:
parent
4791913b5b
commit
5c985d814b
2 changed files with 2 additions and 1 deletions
|
@ -52,6 +52,7 @@ public class Permission {
|
|||
}
|
||||
|
||||
public Permission(String name, String description, PermissionDefault defaultValue, Map<String, Boolean> children) {
|
||||
Validate.notNull(name, "Name cannot be null");
|
||||
this.name = name;
|
||||
this.description = (description == null) ? "" : description;
|
||||
|
||||
|
|
|
@ -615,7 +615,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||
}
|
||||
|
||||
public void recalculatePermissionDefaults(Permission perm) {
|
||||
if (permissions.containsValue(perm)) {
|
||||
if (perm != null && permissions.containsKey(perm.getName().toLowerCase())) {
|
||||
defaultPerms.get(true).remove(perm);
|
||||
defaultPerms.get(false).remove(perm);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue