Skip to content

Conversation

@wally-tg
Copy link

OnMiss callback allow us to operate when key is missing in the cache.

Comment on lines 247 to 253
cache.deleteElement(element)
cache.misses++
if cache.onExpiration != nil {
cache.onExpiration(entry.key, entry.value)
}
return nil, false
}

cache.misses++
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapse miss counter and and return into a single one

@wally-tg
Copy link
Author

closed

@wally-tg wally-tg closed this Feb 28, 2025
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

Successfully merging this pull request may close these issues.

2 participants