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

Features: insert_or_get_mut() #38

Open
LuckyTurtleDev opened this issue Oct 30, 2023 · 0 comments
Open

Features: insert_or_get_mut() #38

LuckyTurtleDev opened this issue Oct 30, 2023 · 0 comments

Comments

@LuckyTurtleDev
Copy link

Hi, it would be nice if a insert_or_get_mut() would exist.

my use case:
The Qp tries store bitmaps. I have a new bitmap A associated with the key 1. I would like the perform a binary and operation if a bitmap B for key 1 is already in the trie otherwise I would like to insert A. So that the value of key 1 is now A & B.

Currently I simple call .insert(A). If I get Some as return value I perform insert(A & B) again. But so I must run twice through the trie.

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

1 participant