remove some more obf helpers

This commit is contained in:
Jake Potrebic
2021-06-16 10:48:25 -07:00
parent 15c337032b
commit 4d67d89033
23 changed files with 45 additions and 268 deletions

View File

@@ -83,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ // this.g();
+ // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error
+ return (V) this.getBackingMap().computeIfPresent(this.getMappingKey(key), (k, v) -> {
+ return (V) this.getBackingMap().computeIfPresent(this.getKeyForUser(key), (k, v) -> {
+ return v.hasExpired() ? null : v;
+ });
+ // Paper end
@@ -99,15 +99,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.getBackingMap().isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic
}
+ protected final String getMappingKey(K k0) { return getKeyForUser(k0); } // Paper - OBFHELPER
protected String getKeyForUser(K profile) {
return profile.toString();
}
@@ -0,0 +0,0 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
return this.map.containsKey(this.getKeyForUser(k0));
}
+ private void removeStaleEntries() { removeExpired(); } // Paper - OBFHELPER
private void removeExpired() {
- List<K> list = Lists.newArrayList();
- Iterator iterator = this.map.values().iterator();
@@ -141,7 +136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public void save() throws IOException {
+ this.removeStaleEntries(); // Paper - remove expired values before saving
+ this.removeExpired(); // Paper - remove expired values before saving
JsonArray jsonarray = new JsonArray();
Stream<JsonObject> stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error
JsonObject jsonobject = new JsonObject();