You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (c *LRU[K, V]) Keys() []K { keys := make([]K, c.evictList.Length()) i := 0 for ent := c.evictList.Back(); ent != nil; ent = ent.PrevEntry() { keys[i] = ent.Key i++ } return keys }
if new elements are added after making the keys array with the c.evictList.length() length. then it will panic and will give index out of range error. Please help us out here.
The text was updated successfully, but these errors were encountered:
Hi,
We are getting index out of range errors while doing concurrent operations. we are getting this error while calling the keys function of lru.
Below is the code where we are getting the issue
golang-lru/simplelru/lru.go
Line 124 in d582c45
func (c *LRU[K, V]) Keys() []K { keys := make([]K, c.evictList.Length()) i := 0 for ent := c.evictList.Back(); ent != nil; ent = ent.PrevEntry() { keys[i] = ent.Key i++ } return keys }
if new elements are added after making the keys array with the c.evictList.length() length. then it will panic and will give index out of range error. Please help us out here.
The text was updated successfully, but these errors were encountered: