mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +01:00
Don't intern strings in ContextSets (#797)
This commit is contained in:
parent
aa4833ed74
commit
a42d27f056
@ -126,8 +126,7 @@ abstract class AbstractContextSet implements ContextSet {
|
|||||||
if (stringIsEmpty(key)) {
|
if (stringIsEmpty(key)) {
|
||||||
throw new IllegalArgumentException("key is (effectively) empty");
|
throw new IllegalArgumentException("key is (effectively) empty");
|
||||||
}
|
}
|
||||||
|
return key.toLowerCase();
|
||||||
return key.toLowerCase().intern();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static String sanitizeValue(String value) {
|
static String sanitizeValue(String value) {
|
||||||
@ -135,8 +134,7 @@ abstract class AbstractContextSet implements ContextSet {
|
|||||||
if (stringIsEmpty(value)) {
|
if (stringIsEmpty(value)) {
|
||||||
throw new IllegalArgumentException("value is (effectively) empty");
|
throw new IllegalArgumentException("value is (effectively) empty");
|
||||||
}
|
}
|
||||||
|
return value;
|
||||||
return value.intern();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean stringIsEmpty(String s) {
|
private static boolean stringIsEmpty(String s) {
|
||||||
|
Loading…
Reference in New Issue
Block a user