From 118e3dba395770ae2f6c3e7d4588fe025ef42e86 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 7 Sep 2022 21:56:41 +0600 Subject: [PATCH] fix of cache filling without clearing of values --- .../dev/inmo/micro_utils/repos/cache/cache/SimpleKVCache.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/cache/SimpleKVCache.kt b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/cache/SimpleKVCache.kt index 56fe1091383..e3321a5fca1 100644 --- a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/cache/SimpleKVCache.kt +++ b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/cache/SimpleKVCache.kt @@ -25,6 +25,9 @@ open class SimpleKVCache( kvParent.unset(it) } } + do { + val removed = cacheQueue.remove(k) + } while (removed) cacheQueue.addLast(k) kvParent.set(k, v) }