Avoid use toImmutableList()

This commit is contained in:
Benoit Marty 2020-03-06 14:39:33 +01:00
parent 62fdb4c27a
commit 2b8e2a312b

View file

@ -76,7 +76,6 @@ import im.vector.matrix.android.internal.session.SessionScope
import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import okhttp3.internal.toImmutableList
import timber.log.Timber import timber.log.Timber
import java.util.UUID import java.util.UUID
import javax.inject.Inject import javax.inject.Inject
@ -986,7 +985,7 @@ internal class DefaultVerificationService @Inject constructor(
val transport = verificationTransportRoomMessageFactory.createTransport(roomId, null) val transport = verificationTransportRoomMessageFactory.createTransport(roomId, null)
// Cancel existing pending requests? // Cancel existing pending requests?
requestsForUser.toImmutableList().forEach { existingRequest -> requestsForUser.toList().forEach { existingRequest ->
existingRequest.transactionId?.let { tid -> existingRequest.transactionId?.let { tid ->
if (!existingRequest.isFinished) { if (!existingRequest.isFinished) {
Timber.d("## SAS, cancelling pending requests to start a new one") Timber.d("## SAS, cancelling pending requests to start a new one")
@ -1047,7 +1046,7 @@ internal class DefaultVerificationService @Inject constructor(
val transport = verificationTransportToDeviceFactory.createTransport(null) val transport = verificationTransportToDeviceFactory.createTransport(null)
// Cancel existing pending requests? // Cancel existing pending requests?
requestsForUser.toImmutableList().forEach { existingRequest -> requestsForUser.toList().forEach { existingRequest ->
existingRequest.transactionId?.let { tid -> existingRequest.transactionId?.let { tid ->
if (!existingRequest.isFinished) { if (!existingRequest.isFinished) {
Timber.d("## SAS, cancelling pending requests to start a new one") Timber.d("## SAS, cancelling pending requests to start a new one")