mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-21 10:52:01 +00:00
minimal optimizations
This commit is contained in:
parent
eea381e714
commit
cd8ef9361b
|
@ -967,15 +967,13 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
||||||
public boolean comparePermissionString(String userAccessLevel, String fullPermissionName) {
|
public boolean comparePermissionString(String userAccessLevel, String fullPermissionName) {
|
||||||
int userAccessLevelLength;
|
int userAccessLevelLength;
|
||||||
if (userAccessLevel == null || fullPermissionName == null
|
if (userAccessLevel == null || fullPermissionName == null
|
||||||
|| (userAccessLevelLength = userAccessLevel.length()) == 0 || fullPermissionName.length() == 0) {
|
|| fullPermissionName.length() == 0 || (userAccessLevelLength = userAccessLevel.length()) == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int userAccessLevelOffset;
|
int userAccessLevelOffset = 0;
|
||||||
if (userAccessLevel.charAt(0) == '+' || userAccessLevel.charAt(0) == '-') {
|
if (userAccessLevel.charAt(0) == '+' || userAccessLevel.charAt(0) == '-') {
|
||||||
userAccessLevelOffset = 1;
|
userAccessLevelOffset = 1;
|
||||||
} else {
|
|
||||||
userAccessLevelOffset = 0;
|
|
||||||
}
|
}
|
||||||
if ("*".regionMatches(0, userAccessLevel, userAccessLevelOffset, userAccessLevelLength - userAccessLevelOffset)) {
|
if ("*".regionMatches(0, userAccessLevel, userAccessLevelOffset, userAccessLevelLength - userAccessLevelOffset)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue