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

Add Features: add MAdd and MGet

Open bjkxt opened this issue 5 years ago • 5 comments

Update lru.go. Simple functions for many keys' operations with less mutex race.

bjkxt avatar Nov 24 '20 07:11 bjkxt

A change just went in that updates how eviction is handled -- can you update this PR against it?

jefferai avatar Jan 04 '21 14:01 jefferai

@bjkxt Got an approval from Brian, just looking for your changes against the new eviction code I think!

jefferai avatar Feb 01 '21 17:02 jefferai

@bjkxt Got an approval from Brian, just looking for your changes against the new eviction code I think!

I think MAdd just takes the evictions of input keys and values to the caller. And the caller can decide how to handle these evictions.

bjkxt avatar Mar 09 '21 10:03 bjkxt

Two issues:

  • There seem to be no tests for this functionality
  • The code doesn't actually check whether the various slices are the same length, so it will panic if the caller provides bad input

jefferai avatar Mar 09 '21 13:03 jefferai

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Sep 09 '21 09:09 hashicorp-cla