release v2026.05.11.3: caching, perf, playlist polish #41
@@ -34,8 +34,9 @@ class DetailSeedCache @Inject constructor() {
|
|||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
private const val MAX_ENTRIES = 32
|
private const val MAX_ENTRIES = 32
|
||||||
|
private const val LOAD_FACTOR = 0.75f
|
||||||
private fun <V> lru(max: Int): MutableMap<String, V> =
|
private fun <V> lru(max: Int): MutableMap<String, V> =
|
||||||
object : LinkedHashMap<String, V>(max, 0.75f, true) {
|
object : LinkedHashMap<String, V>(max, LOAD_FACTOR, true) {
|
||||||
override fun removeEldestEntry(eldest: Map.Entry<String, V>) = size > max
|
override fun removeEldestEntry(eldest: Map.Entry<String, V>) = size > max
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user