In the kotlin stdlib the `LinkedHashMap` does not ...
# stdlib
t
In the kotlin stdlib the
LinkedHashMap
does not have the
accessOrder
property that the
java.util.LinkedHashMap
has. Is there a replacement if I want to use such a functionality, for example for as a LRU cache? Or should I look for a third party library for simple LRU caching (with kotlin multiplatform support)?
j
t
Thanks, that is similar to how I implemented it myself (except that I also need a refresh on get since eviction is LRU).
java.util.LinkedHashMap
has the advantage that it can do the refresh on access in one step (access + move to end) while the decorator approach has multiple steps. Probably wont matter too much.