mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-10 02:13:50 +00:00
small change in MapWriteKeyValuesRepo.set and remove duration of FullKeyValuesCacheRepoTests.creatingWorksProperly
This commit is contained in:
parent
75f21f3b8a
commit
5a668205c0
@ -10,7 +10,7 @@ import kotlin.test.*
|
|||||||
|
|
||||||
class FullKeyValuesCacheRepoTests {
|
class FullKeyValuesCacheRepoTests {
|
||||||
@Test
|
@Test
|
||||||
fun creatingWorksProperly() = runTest(timeout = 1.days) {
|
fun creatingWorksProperly() = runTest {
|
||||||
val testData = (0 until 1000).associate {
|
val testData = (0 until 1000).associate {
|
||||||
("$it-" + uuid4().toString()) to (0 until 1000).map {
|
("$it-" + uuid4().toString()) to (0 until 1000).map {
|
||||||
"$it-" + uuid4().toString()
|
"$it-" + uuid4().toString()
|
||||||
|
@ -110,9 +110,9 @@ class MapWriteKeyValuesRepo<Key, Value>(
|
|||||||
|
|
||||||
override suspend fun set(toSet: Map<Key, List<Value>>) {
|
override suspend fun set(toSet: Map<Key, List<Value>>) {
|
||||||
locker.withWriteLock {
|
locker.withWriteLock {
|
||||||
toSet.forEach {
|
map.putAll(
|
||||||
map[it.key] = it.value.toMutableList()
|
toSet.mapValues { it.value.toMutableList() }
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
toSet.forEach { (k, v) ->
|
toSet.forEach { (k, v) ->
|
||||||
v.forEach {
|
v.forEach {
|
||||||
|
Loading…
Reference in New Issue
Block a user