golang-lru
golang-lru copied to clipboard
Add method GetAndAdd to LRU Cache
Hi, Sometimes it's useful to get value by key and set a new one atomically (like getset in the Redis).
This needs to be reworked against the locking/eviction changes that were just merged. But will be happy to have it after!
@jefferai ok, done. Please review.
One comment -- looks good otherwise. Let me know if you agree with that proposal.
Yes, you are right, fixed.
@jefferai could you please review and merge if all is ok?