dev.arbjerg.lavalink.internal.loadbalancing.LRUCache.kt Maven / Gradle / Ivy
package dev.arbjerg.lavalink.internal.loadbalancing
// 0.75 is the default load factor for LinkedHashMap
class LRUCache(private val limit: Int) : LinkedHashMap(limit, 0.75f, true) {
override fun removeEldestEntry(eldest: MutableMap.MutableEntry?): Boolean {
return size > limit
}
}