Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnEvict was not correctly called on element #190

Open
MinhNghiaD opened this issue Feb 11, 2025 · 0 comments
Open

OnEvict was not correctly called on element #190

MinhNghiaD opened this issue Feb 11, 2025 · 0 comments

Comments

@MinhNghiaD
Copy link

MinhNghiaD commented Feb 11, 2025

Hello, I'm using LRU cache with eviction to manage a small cache. During the usage, I noticed the onEvict doesn't call on all evicted elements. After dig into the code, it seems like at this code, instead of pop the evicted element as a queue, the entire eviction list is reset

c.evictedKeys, c.evictedVals = c.evictedKeys[:0], c.evictedVals[:0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant