lru icon indicating copy to clipboard operation
lru copied to clipboard

Query about interface (possible misunderstanding of semantics)

Open tomjridge opened this issue 5 years ago • 2 comments

Great library!

If I have an entry k->v, and I want to change it to k->v', is there a way to do this without altering the "least recently used" information? (Does this question make sense?)

I think I want something like the "add" function, but where the k->v' binding is not necessarily the "most recently used".

tomjridge avatar Feb 18 '20 12:02 tomjridge

Looking at the implementation, and also at psq, I think I want a function like psq's "adjust".

tomjridge avatar Feb 18 '20 14:02 tomjridge

I should add that in my application, all v have weight 1. So replacing k->v with k-> v' doesn't need to adjust weights or anything like that.

tomjridge avatar Feb 18 '20 14:02 tomjridge