9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 09:59:15 +00:00

Fix async entity tracker (#241)

* Fix Multithreaded Tracker

* [ci skip] Add comments
This commit is contained in:
Creeam
2025-02-27 12:11:28 -08:00
committed by GitHub
parent 68653110bc
commit 2e5ea6957e
2 changed files with 34 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package org.dreeam.leaf.util.map;
import com.google.common.collect.Interner;
import com.google.common.collect.Interners;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
@@ -9,11 +10,12 @@ import java.util.function.Function;
public class StringCanonizingOpenHashMap<T> extends Object2ObjectOpenHashMap<String, T> {
private static final com.google.common.collect.Interner<String> KEY_INTERNER = Interners.newWeakInterner();
private static final Interner<String> KEY_INTERNER = Interners.newWeakInterner();
private static String intern(String key) {
return key != null ? KEY_INTERNER.intern(key) : null;
}
public StringCanonizingOpenHashMap() {
super();
}