dgraph-io / ristretto

A high performance memory-bound Go cache

Home Page:https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible bug when processing items

mariecurried opened this issue · comments

I was reading through the code to see how you implemented "ristretto" and I came up to this line: https://github.com/dgraph-io/ristretto/blob/master/cache.go#L201.

c.onEvict(item.key, item.val, item.cost)

I might be wrong, because I don't yet fully understand the code involved, but shouldn't it be:

c.onEvict(victim.key, victim.val, victim.cost)

Thanks, you're correct. It should be fixed in #51.