Skip to content
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

Simplify code by not calling Set.contains() before add() #83

Merged
merged 2 commits into from
Jan 1, 2024

Conversation

mebigfatguy
Copy link
Contributor

No need to do contains before add, just does two set traversals instead of one.

@cowtowncoder cowtowncoder changed the title simplify by not calling contains before add implify by not calling contains before add Jan 1, 2024
@cowtowncoder cowtowncoder changed the title implify by not calling contains before add Simplify code by not calling Set.contains() before add() Jan 1, 2024
@cowtowncoder
Copy link
Member

Makes sense: my only (theoretical) concern would be with LRU-style LinkedHashSet (where ordering could change), but I'm pretty sure that isn't relevant here.

Thanks!

@cowtowncoder cowtowncoder merged commit 6095105 into FasterXML:master Jan 1, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants