We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Good: (simple.go)
simple.go
func (c *SimpleCache) remove(key interface{}) bool { item, ok := c.store[key] if ok { delete(c.store, key) if c.evictedFunc != nil { c.evictedFunc(key, item.value) } return true } return false }
This is the internal remove function. Let us walk through it:
delete(c.store, key)
Bad:
func (c *ARC) Remove(key interface{}) bool { c.mu.Lock() defer c.mu.Unlock() elt, exists := c.store[key] if !exists { return false } if elt.parent != nil { elt.parent.Remove(elt.element) } delete(c.store, elt.key) c.size-- return true }
Goal: Make the good behavior consistent across the library
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Good: (
simple.go
)This is the internal remove function. Let us walk through it:
delete(c.store, key)
)Bad:
Goal: Make the good behavior consistent across the library
The text was updated successfully, but these errors were encountered: