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

[chore] update gruf / {go-cache, go-maps, go-kv} #3361

Conversation

@@ -54,15 +54,17 @@ func (m *ordered[K, V]) Delete(key K) bool {

// Range passes given function over the requested range of the map.
func (m *ordered[K, V]) Range(start, length int, fn func(int, K, V)) {
// Nil check
if fn == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

it's a very simple fix (i wasn't correctly doing a nil check), but it should help in doing very large ranges on these ordered map types (used within our ttl caches, of which we still have a few), as the compiler should now know it doesn't need to do a nil check on every loop iteration.

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit 2f582e2 into superseriousbusiness:main Sep 27, 2024
2 checks passed
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.

1 participant