From 3193e1649850314b653546765b1af6f9250b70c9 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sat, 12 Oct 2024 17:02:50 -0700 Subject: [PATCH] Weak assumption - Use a weak hash set for PipelineCompiler.ALL --- .../flywheel/backend/compile/PipelineCompiler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/backend/java/dev/engine_room/flywheel/backend/compile/PipelineCompiler.java b/common/src/backend/java/dev/engine_room/flywheel/backend/compile/PipelineCompiler.java index 23d405731..c01f8284b 100644 --- a/common/src/backend/java/dev/engine_room/flywheel/backend/compile/PipelineCompiler.java +++ b/common/src/backend/java/dev/engine_room/flywheel/backend/compile/PipelineCompiler.java @@ -1,8 +1,10 @@ package dev.engine_room.flywheel.backend.compile; -import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; +import java.util.Set; +import java.util.WeakHashMap; import dev.engine_room.flywheel.api.Flywheel; import dev.engine_room.flywheel.api.instance.InstanceType; @@ -31,7 +33,7 @@ import dev.engine_room.flywheel.lib.util.ResourceUtil; import net.minecraft.resources.ResourceLocation; public final class PipelineCompiler { - private static final List ALL = new ArrayList<>(); + private static final Set ALL = Collections.newSetFromMap(new WeakHashMap<>()); private static final Compile PIPELINE = new Compile<>();