Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently LRUCache just provides basic cache function(i.e. get, put), which can not make sure same entry will not be added multi-times easily and effectively.
In order to resolve the above problem, ConcurrentLinkedHashMap is refined to support `computeIfAbsent`, which is key function for caches. In addition, LRUCache implements `getAndPut`, which is based on the `computeIfAbsent`.
Note: the improvement is only available in Groovy 3.0.0+