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

Identic return for get_or_store #10

Closed
essenciary opened this issue May 3, 2015 · 3 comments
Closed

Identic return for get_or_store #10

essenciary opened this issue May 3, 2015 · 3 comments

Comments

@essenciary
Copy link

The get_or_store function can not be properly used due to the fact that it returns different values whether it gets or stores.

If I'm missing the intended use case, please provide an example. Otherwise the correct implementation should be to always return the value, either after get, either after storing (instead of :ok).

@sasa1977
Copy link
Owner

sasa1977 commented May 3, 2015

I just looked into the code, and as far as I can tell, get_or_store should always return the value. This is confirmed by typespec of the function and the tests. Can you show a code snippet where this doesn't happen?

@essenciary
Copy link
Author

I refactored the code to work around it. Let me try to revert it / extract it and I'll get back to you.

@essenciary
Copy link
Author

Can't replicate it anymore so probably my code was doing something funky. Thanks for your support - I'll close this and reopen if I'll be able to reproduce it down the road. Cheers!

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