-
Notifications
You must be signed in to change notification settings - Fork 49
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
Implement compute_if_present #32
Conversation
This looks quite good! I left a couple of inline notes. It makes me want to try to figure out how we might be able to unify the code for |
@voidc Hmm, why do you want the semantics to be that it returns the new value rather than the old? Or, I guess, it could return both? |
Hi! Thanks for the comments! |
Ohh, I see, I missed that! Yes, I think returning references to both old and new would be good. |
@voidc Hi, I just submitted #35 to deal with #9 and noticed you are also matching against |
@voidc Unless there's more you want to do with this, I think I'm happy to merge once you bring it up to date with |
Codecov Report
|
Thanks for the approval! Feel free to merge.
|
This pull request contains the compute_if_present method, which is the simplest one among the reservation-based methods mentioned in #12 since it does not require ReservationNodes.
I took most of the code from put and remove.
For now, I only added basic tests but I also want to port some of the Java tests.