From 068ec3dda798766b88d77d65393a2fcf4838ecbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 24 Apr 2023 16:23:56 +0200 Subject: [PATCH] Change listeners in Catalog from List to Set makes more sense as the same listener should not be added twice. Also faster remove op. --- .../java/org/neo4j/gds/core/loading/GraphStoreCatalog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/neo4j/gds/core/loading/GraphStoreCatalog.java b/core/src/main/java/org/neo4j/gds/core/loading/GraphStoreCatalog.java index 754a111d0a..00c11f4493 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/GraphStoreCatalog.java +++ b/core/src/main/java/org/neo4j/gds/core/loading/GraphStoreCatalog.java @@ -28,12 +28,12 @@ import org.neo4j.gds.utils.StringJoining; import org.neo4j.logging.Log; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.NoSuchElementException; import java.util.Optional; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -45,7 +45,7 @@ public final class GraphStoreCatalog { private static final ConcurrentHashMap userCatalogs = new ConcurrentHashMap<>(); - private static final List listeners = new ArrayList<>(); + private static final Set listeners = new HashSet<>(); // as we want to use the Neo4j log if possible and the catalog is a static instance, // we make the log injectable