Skip to content

Commit

Permalink
Change listeners in Catalog from List to Set
Browse files Browse the repository at this point in the history
makes more sense as the same listener should not be added twice. Also faster remove op.
  • Loading branch information
FlorentinD committed Apr 25, 2023
1 parent de316e0 commit 068ec3d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -45,7 +45,7 @@ public final class GraphStoreCatalog {

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

private static final List<GraphStoreCatalogListener> listeners = new ArrayList<>();
private static final Set<GraphStoreCatalogListener> 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
Expand Down

0 comments on commit 068ec3d

Please sign in to comment.