ricardobcl/ETScache — pull request #1 by aliyakamercan (2013-02-08 22:33:24+00:00)
Title: put_new & update problems

if you try to put an existing key, a key is removed from the cache (when the cache is full of course) but the size is never reduced. If this is repeated enough times, the cache will only holds only one item, but assume it's at max capacity. Simply check to if you are actually going to insert the new key before deleting anything. Also update doesn't check if the element is there before inserting, thus not respecting the capacity. I also added some tests.