This project is read-only.
2
Vote

NullReferenceException in LRUCache

description

There is a bug in LRUCache implementation in method GetValue. When removing first item after capacity limit was hit there are double remove from 'lruList' and single remove from 'data', so from that point 'lruList' start shrinking until there are no items left and 'lruList.First' will throw NullReferenceException.

I've attached fixed LRUCache.cs with commented second remove from 'lruList'.

file attachments

comments