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

Delete counters of qualified limits #399

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

alexsnaps
Copy link
Member

I don't think this is really a desirable fix to be honest... O(n) isn't really sustainable.
Probably resorting to a ordered collection and have all qualified counters for a qualified limit next to each other would be better... I'll see what I can do as part of #397

let l = limit.clone();
match self
.qualified_counters
.invalidate_entries_if(move |c, _| c.limit() == &l)
Copy link
Member Author

@alexsnaps alexsnaps Dec 11, 2024

Choose a reason for hiding this comment

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

Whether an entry actually needs invalidation will be checked for on the .get path by moka... so this isn't racy

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

Successfully merging this pull request may close these issues.

1 participant