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

Remove comment about unsafe Range() and Reverse() #4

Merged
merged 1 commit into from
May 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions lru.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ func (lru *LRU) Delete(key interface{}) (prev interface{}, deleted bool) {

// Range iterates over all key/values in the order of most recently to
// least recently used items.
// It's not safe to call other LRU operations while ranging.
func (lru *LRU) Range(iter func(key interface{}, value interface{}) bool) {
lru.mu.RLock()
defer lru.mu.RUnlock()
Expand All @@ -192,7 +191,6 @@ func (lru *LRU) Range(iter func(key interface{}, value interface{}) bool) {

// Reverse iterates over all key/values in the order of least recently to
// most recently used items.
// It's not safe to call other LRU operations while ranging.
func (lru *LRU) Reverse(iter func(key interface{}, value interface{}) bool) {
lru.mu.RLock()
defer lru.mu.RUnlock()
Expand Down