Skip to content

Commit 068ec3d

Browse files
committed
Change listeners in Catalog from List to Set
makes more sense as the same listener should not be added twice. Also faster remove op.
1 parent de316e0 commit 068ec3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/java/org/neo4j/gds/core/loading/GraphStoreCatalog.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
import org.neo4j.gds.utils.StringJoining;
2929
import org.neo4j.logging.Log;
3030

31-
import java.util.ArrayList;
32-
import java.util.List;
31+
import java.util.HashSet;
3332
import java.util.Locale;
3433
import java.util.Map;
3534
import java.util.NoSuchElementException;
3635
import java.util.Optional;
36+
import java.util.Set;
3737
import java.util.concurrent.ConcurrentHashMap;
3838
import java.util.function.Consumer;
3939
import java.util.stream.Collectors;
@@ -45,7 +45,7 @@ public final class GraphStoreCatalog {
4545

4646
private static final ConcurrentHashMap<String, UserCatalog> userCatalogs = new ConcurrentHashMap<>();
4747

48-
private static final List<GraphStoreCatalogListener> listeners = new ArrayList<>();
48+
private static final Set<GraphStoreCatalogListener> listeners = new HashSet<>();
4949

5050
// as we want to use the Neo4j log if possible and the catalog is a static instance,
5151
// we make the log injectable

0 commit comments

Comments
 (0)