mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-01-23 16:41:48 +01:00
Correctly clean counter to fix HashedList#contains method
ported from lithium
This commit is contained in:
parent
80a494c570
commit
b02e858b3e
@ -8,7 +8,7 @@ you can find the original code on https://github.com/jellysquid3/lithium-fabric/
|
||||
|
||||
diff --git a/src/main/java/me/jellysquid/mods/lithium/common/util/collections/HashedList.java b/src/main/java/me/jellysquid/mods/lithium/common/util/collections/HashedList.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..640e1bc80d1989f3580081d8d484059075fbd8f5
|
||||
index 0000000000000000000000000000000000000000..2d79932dbd1fc386a94b8d6ea3526934c54c2aad
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/jellysquid/mods/lithium/common/util/collections/HashedList.java
|
||||
@@ -0,0 +1,280 @@
|
||||
@ -283,7 +283,7 @@ index 0000000000000000000000000000000000000000..640e1bc80d1989f3580081d8d4840590
|
||||
+
|
||||
+ @SuppressWarnings("unchecked")
|
||||
+ private void trackReferenceRemoved(Object o) {
|
||||
+ if (this.counter.addTo((T) o, -1) <= 0) {
|
||||
+ if (this.counter.addTo((T) o, -1) <= 1) {
|
||||
+ this.counter.removeInt(o);
|
||||
+ }
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user