Commit Graph

1 Commits

Author SHA1 Message Date
Aikar
998bf84e4c
Performance & Concurrency Improvements to Permissions
Modifying of permissions was only half protected, enabling concurrency
issues to occur if permissions were modified async.

While no plugin really should be doing that, modifying operations
are not heavily called, so they are safe to add synchronization to.

Now, all modification API's will be synchronized ensuring safety.

Additionally, hasPermission was victim to a common java newbie mistake
of calling if (containsKey(k)) return get(k), resulting in 2 map lookups.

Optimized it to simply be a single get call cutting permission map
lookups in half.
2018-09-13 20:55:31 -04:00