-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: duplicate events #4076
Fix: duplicate events #4076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will just silently ignore a duplicate, but the issue requests that it errors and exits. This should be an easy addition. Can you add that @tippenein?
@obycode Re-thinking my original issue request, this may actually be a better solution since it still guards against user error while preserving flexibility to run the binary. |
Works for me! |
aced36f
to
fc61021
Compare
fix: #2810
This simply uses a HashSet for
event_observers
which means it might not be exactly what the issue asked for but I'm putting it here for discussion. It wouldn't be particularly hard to WARN in the case of inserting an event observer which is already specified, but maybe it's sufficient to just disallow it?(didn't add any tests because it ends up just testing HashSet's insert..)