Skip to content

Commit

Permalink
Weak assumption
Browse files Browse the repository at this point in the history
- Use a weak hash set for PipelineCompiler.ALL
  • Loading branch information
Jozufozu committed Oct 13, 2024
1 parent efb68dc commit 3193e16
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -31,7 +33,7 @@
import net.minecraft.resources.ResourceLocation;

public final class PipelineCompiler {
private static final List<PipelineCompiler> ALL = new ArrayList<>();
private static final Set<PipelineCompiler> ALL = Collections.newSetFromMap(new WeakHashMap<>());

private static final Compile<PipelineProgramKey> PIPELINE = new Compile<>();

Expand Down

0 comments on commit 3193e16

Please sign in to comment.