Skip to content

Commit

Permalink
Use an identity hash set for synced tags
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Dec 6, 2024
1 parent 2ac8a86 commit 7d30183
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/ac/grim/grimac/utils/data/tags/SyncedTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerTags;

import java.util.Collections;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Set;
import java.util.function.Function;

Expand All @@ -15,7 +17,7 @@ public final class SyncedTag<T> {

private SyncedTag(ResourceLocation location, Function<Integer, T> remapper, Set<T> defaultValues) {
this.location = location;
this.values = new HashSet<>();
this.values = Collections.newSetFromMap(new IdentityHashMap<>());
this.remapper = remapper;
this.values.addAll(defaultValues);
}
Expand Down

0 comments on commit 7d30183

Please sign in to comment.