Based on the generated code when the limit is reached you are deleting the first entry in the map. This is not necessarily the least recently used entry in the cache.
So to my understanding this actually behaves like a FIFO and not like a LRU cache.
For a true LRU cache you would need to change the order of the map by for example removing and re-adding the found item making sure that the first item in the list is the one which was not been used for the longest time.
Am I missing something here?
Based on the generated code when the limit is reached you are deleting the first entry in the map. This is not necessarily the least recently used entry in the cache.
So to my understanding this actually behaves like a FIFO and not like a LRU cache.
For a true LRU cache you would need to change the order of the map by for example removing and re-adding the found item making sure that the first item in the list is the one which was not been used for the longest time.
Am I missing something here?