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

Add getOrElseUpdate method to debox.Map #22

Merged
merged 2 commits into from
Jun 7, 2015
Merged

Add getOrElseUpdate method to debox.Map #22

merged 2 commits into from
Jun 7, 2015

Conversation

JD557
Copy link
Contributor

@JD557 JD557 commented Jun 6, 2015

This PR adds a getOrElseUpdate method to debox.Map, which should be faster than a simple getOrElse followed by an update, as it only needs to iterate once over the possible values.

@non
Copy link
Owner

non commented Jun 6, 2015

This change looks great.

Would you be willing to add a test that uses this method? Once you do that I'd be happy to merge it.

@JD557
Copy link
Contributor Author

JD557 commented Jun 6, 2015

Thanks for your feedback.

I just added some tests for the getOrElse and getOrElseUpdate methods. I don't usually work with scalatest, so if something's wrong please say so.

@non
Copy link
Owner

non commented Jun 7, 2015

Looks good to me. Thanks for adding the tests.

👍

non added a commit that referenced this pull request Jun 7, 2015
Add getOrElseUpdate method to debox.Map
@non non merged commit b9c3d6d into non:master Jun 7, 2015
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