Skip to content

Commit

Permalink
use set for webhook clients
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmakila committed Sep 26, 2024
1 parent 827a31a commit b879029
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public final class WebhookRegistry {
private final Map<EventType, List<DiscordClient>> eventClientMap = new EnumMap<>(EventType.class);
private final List<DiscordClient> clients = new ArrayList<>();
private final Set<DiscordClient> clients = new HashSet<>();

public void register(final DiscordClient client, final List<EventType> events) {
this.clients.add(client);
Expand All @@ -22,8 +22,8 @@ public List<DiscordClient> forEventType(EventType type) {
return this.eventClientMap.get(type);
}

public List<DiscordClient> webhooks() {
return List.copyOf(this.clients);
public Set<DiscordClient> webhooks() {
return Set.copyOf(this.clients);
}

public Set<EventType> registeredEventTypes() {
Expand Down

0 comments on commit b879029

Please sign in to comment.