golang-lru icon indicating copy to clipboard operation
golang-lru copied to clipboard

implement GetOrAdd to LRU

Open raf555 opened this issue 1 year ago • 1 comments

Sometimes there would be a case where we want to get the value while updating the recent-ness and add the value if it's not found. PeekOrAdd does have similar logic but does not update the recent-ness, hence this PR.

raf555 avatar Feb 03 '24 12:02 raf555

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Feb 03 '24 12:02 hashicorp-cla