Skip to content

OnEvict was not correctly called on element #190

Description

@MinhNghiaD

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions