You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you call Get it updates the recent-ness of the item...after all this is an LRU. The documentation for Contains is indicating that it does not do this, so calling it will not affect whether it's considered least recently used or not. It also won't trigger an eviction, as in, it won't check to ensure if the eviction process needs to be run.
Yes, I understand the recent-ness part and that is necessary for the documentation. But I was confused why eviction was mentioned under Contains. We don't mention eviction under Get() method and under Peek() method, and that is understood.
So when I found eviction statement under Contains, I thought maybe we have lazy eviction wherein the keys are removed on access, if they are stale. That is why I wanted to clarify.
Going through the documentation, I am bit confused about the wording in there
AFAIK, eviction in LRU happens only on addition.
If that is correct, why do we even mention
eviction
while checking for presence withContains()
method.Is there any LRU that marks elements as stale without deleting them ? And evicts them while checking for presence ?
The text was updated successfully, but these errors were encountered: