Skip to content

Commit

Permalink
Rename field
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed May 29, 2024
1 parent 9674cb0 commit 1d6d474
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@

public final class MapHandler<K, V> {
private final MapKey<K, V> baseKey;
private final Map<MapKey<K, V>, ClientMapHolder<K, V, Map<K, V>>> map;
private final Map<MapKey<K, V>, ClientMapHolder<K, V, Map<K, V>>> holders;

public MapHandler(MapKey<K, V> baseKey) {
this.baseKey = baseKey;
this.map = new Reference2ObjectOpenHashMap<>();
this.holders = new Reference2ObjectOpenHashMap<>();
}

MapHolder<K, V> getHolder(MapKey<K, V> mapKey) {
return getOrCreateHolder(mapKey);
}

void clear() {
map.values().forEach(kvMapClientMapHolder -> {
holders.values().forEach(kvMapClientMapHolder -> {
kvMapClientMapHolder.backing = null;
kvMapClientMapHolder.optionalKeys = null;
});
}

private ClientMapHolder<K, V, Map<K, V>> getOrCreateHolder(MapKey<K, V> key) {
return map.computeIfAbsent(key, ClientMapHolder::new);
return holders.computeIfAbsent(key, ClientMapHolder::new);
}

void parse(ResourceLocation resolverPath, FileToIdConverter converter, ResourceManager resourceManager) {
Expand Down

0 comments on commit 1d6d474

Please sign in to comment.