Avoid unnecessary lock acquisition.

This commit is contained in:
Nicholas Tinsley
2023-11-03 15:12:29 -04:00
parent 29350ab7b0
commit 761553d392

View File

@@ -60,10 +60,12 @@ class BufferedSenderKeyStore : SignalServiceSenderKeyStore {
persistentStore.storeSenderKey(key.address, key.distributionId, record)
}
persistentStore.clearSenderKeySharedWith(clearSharedWith)
if (clearSharedWith.isNotEmpty()) {
persistentStore.clearSenderKeySharedWith(clearSharedWith)
clearSharedWith.clear()
}
updatedKeys.clear()
clearSharedWith.clear()
}
private fun UUID.toDistributionId() = DistributionId.from(this)