Reuse $0 parameter

This commit is contained in:
Benoit Marty 2022-10-18 14:07:01 +02:00
parent 27bbd18a74
commit 2db5f5a5f0
3 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ internal fun RealmList<ThreadSummaryEntity>.find(rootThreadEventId: String): Thr
internal fun ThreadSummaryEntity.Companion.findRootOrLatest(realm: TypedRealm, eventId: String): ThreadSummaryEntity? {
return realm.query(ThreadSummaryEntity::class)
.query("rootThreadEventId == $0 OR latestThreadEventEntity.eventId == $1", eventId, eventId)
.query("rootThreadEventId == $0 OR latestThreadEventEntity.eventId == $0", eventId)
.first()
.find()
}

View File

@ -99,7 +99,7 @@ internal class DefaultFinalizeAddingThreePidTask @Inject constructor(
// Delete the pending three pid
realmInstance.write {
val pendingThreePidEntities = query(PendingThreePidEntity::class)
.query("email == $0 OR msisdn == $1", params.threePid.value, params.threePid.value)
.query("email == $0 OR msisdn == $0", params.threePid.value)
.find()
delete(pendingThreePidEntities)
}

View File

@ -73,7 +73,7 @@ internal class UserDataSource @Inject constructor(
query = if (filter.isNullOrEmpty()) {
query.query("userId != ''")
} else {
query.query("displayName CONTAINS[c] $0 OR userId CONTAINS $1", filter, filter)
query.query("displayName CONTAINS[c] $0 OR userId CONTAINS $0", filter)
}
excludedUserIds
?.takeIf { it.isNotEmpty() }