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

Would it be possible to have add_if_not_contains? #6

Closed
craigschmidt opened this issue Jun 9, 2023 · 2 comments
Closed

Would it be possible to have add_if_not_contains? #6

craigschmidt opened this issue Jun 9, 2023 · 2 comments

Comments

@craigschmidt
Copy link

Your library looks great. My use case is in deduplication, so I would be wanting to know if a given string is already in the Bloom filter, and add it if not. I can certainly make a call to contains, and then a call to add_str, but it seems like that will be repeating computing all the hash values. I assume it would run roughly twice as slow as a combined function could. Would that be something that would be possible to add? It would return whether it was added or not. Thanks!

yankun1992 added a commit that referenced this issue Jul 10, 2023
@yankun1992
Copy link
Owner

Hi @craigschmidt , sorry for not noticing this issue. I submitted some code to implement the add_if_not_contains method, do you see that it meets your needs?

@yankun1992
Copy link
Owner

Release version 0.5.4. Closed.

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

No branches or pull requests

2 participants