{"action":"created","issue":{"url":"https://api.github.com/repos/bluele/gcache/issues/43","repository_url":"https://api.github.com/repos/bluele/gcache","labels_url":"https://api.github.com/repos/bluele/gcache/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/bluele/gcache/issues/43/comments","events_url":"https://api.github.com/repos/bluele/gcache/issues/43/events","html_url":"https://github.com/bluele/gcache/issues/43","id":261843041,"number":43,"title":"Len() function of Cache interface unnecessarily (presumably) calls  GetALL","user":{"login":"kogan69","id":12115495,"avatar_url":"https://avatars0.githubusercontent.com/u/12115495?v=4","gravatar_id":"","url":"https://api.github.com/users/kogan69","html_url":"https://github.com/kogan69","followers_url":"https://api.github.com/users/kogan69/followers","following_url":"https://api.github.com/users/kogan69/following{/other_user}","gists_url":"https://api.github.com/users/kogan69/gists{/gist_id}","starred_url":"https://api.github.com/users/kogan69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kogan69/subscriptions","organizations_url":"https://api.github.com/users/kogan69/orgs","repos_url":"https://api.github.com/users/kogan69/repos","events_url":"https://api.github.com/users/kogan69/events{/privacy}","received_events_url":"https://api.github.com/users/kogan69/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-30T13:10:42Z","updated_at":"2018-02-13T18:22:28Z","closed_at":null,"author_association":"NONE","body":"Apologies upfront for a possible misunderstanding of some fundamental concept, but I just couldn't figure out why not to return len(items) instead?\r\nOr in other words, why to create a full copy of the cache when the only thing that is required to know is it's size?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bluele/gcache/issues/comments/365357296","html_url":"https://github.com/bluele/gcache/issues/43#issuecomment-365357296","issue_url":"https://api.github.com/repos/bluele/gcache/issues/43","id":365357296,"user":{"login":"pcman312","id":72365,"avatar_url":"https://avatars2.githubusercontent.com/u/72365?v=4","gravatar_id":"","url":"https://api.github.com/users/pcman312","html_url":"https://github.com/pcman312","followers_url":"https://api.github.com/users/pcman312/followers","following_url":"https://api.github.com/users/pcman312/following{/other_user}","gists_url":"https://api.github.com/users/pcman312/gists{/gist_id}","starred_url":"https://api.github.com/users/pcman312/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcman312/subscriptions","organizations_url":"https://api.github.com/users/pcman312/orgs","repos_url":"https://api.github.com/users/pcman312/repos","events_url":"https://api.github.com/users/pcman312/events{/privacy}","received_events_url":"https://api.github.com/users/pcman312/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T18:22:28Z","updated_at":"2018-02-13T18:22:28Z","author_association":"CONTRIBUTOR","body":"The `Len` function on the LRU cache has an unfortunate side effect because of how `GetALL` works: Because it calls `GetIfPresent` for each key in the cache via a `range` on `items` each item in the cache will be randomly reordered in the eviction list because of the randomness of ranging over a map."}}
{"actor":{"display_login":"pcman312"}}