crypto: Use getOrPut instead of getOrDefault

getOrDefault won't insert the default value into the map, while we do
want it to be inserted.
This commit is contained in:
Damir Jelić 2021-10-12 12:08:38 +02:00
parent 504fd95b26
commit c266842da9
1 changed files with 1 additions and 1 deletions

View File

@ -874,7 +874,7 @@ internal class DefaultCryptoService @Inject constructor(
}
}
val keyShareLock = roomKeyShareLocks.getOrDefault(roomId, Mutex())
val keyShareLock = roomKeyShareLocks.getOrPut(roomId, { Mutex() })
keyShareLock.withLock {
coroutineScope {