This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Description
Hi, I was looking at the caching code and I found some points which can be enhanced to avoid creating unnecessary objects. I'm referring to the class MemoryCache, the private field _entries can be a Dictionary<string, CacheEntry> instead of anIDictionary<string, CacheEntry> (since it's private and it's always initialized to a Dictionary<string, CacheEntry>) thus saving some unnecessary memory allocation when iterating over Keys and Values. Also the RemoveEntries method could be changed to accept a List instead of IEnumerable<CacheEntry> (since it's a private method always called with an instance of List<CacheEntry>) saving 1 object allocation when iterating over the list of entries. This change will also be consistent with the method ExpirePriorityBucket which already accept generic lists parameters.
It's not a huge improvement, but it's a fairly simple one at least IMHO.
Max.