Use Massive collections to avoid null checks, convert to lower case and use quicker permission and flag checking.

This commit is contained in:
Olof Larsson
2014-11-13 11:41:21 +01:00
parent aa0edb28b7
commit a376fffa47
6 changed files with 227 additions and 200 deletions

View File

@@ -43,7 +43,11 @@ public class FactionPreprocessAdapter implements JsonDeserializer<Faction>
rename(jsonObject, "permOverrides", "perms");
}
public void rename(final JsonObject jsonObject, final String from, final String to)
// -------------------------------------------- //
// UTIL
// -------------------------------------------- //
public static void rename(final JsonObject jsonObject, final String from, final String to)
{
JsonElement element = jsonObject.remove(from);
if (element != null) jsonObject.add(to, element);