Skip to content

Commit

Permalink
fix registry to persist script order (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
pietro-lopes authored May 20, 2024
1 parent d1a1111 commit e293687
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
Expand Down Expand Up @@ -141,7 +141,7 @@ public void listen(ScriptType type, @Nullable Object extraId, IEventHandler hand
map = eventContainers;
} else {
if (extraEventContainers == null) {
extraEventContainers = extra.identity ? new IdentityHashMap<>() : new HashMap<>();
extraEventContainers = extra.identity ? new LinkedHashMap<>() : new HashMap<>();
}

map = extraEventContainers.get(extraId);
Expand Down Expand Up @@ -359,7 +359,7 @@ public Set<Object> findUniqueExtraIds(ScriptType type) {
return Set.of();
}

var set = new HashSet<>();
var set = new LinkedHashSet<>();

forEachListener(type, c -> {
if (c.extraId != null) {
Expand Down

0 comments on commit e293687

Please sign in to comment.