Reuse $0 parameter
This commit is contained in:
parent
27bbd18a74
commit
2db5f5a5f0
@ -57,7 +57,7 @@ internal fun RealmList<ThreadSummaryEntity>.find(rootThreadEventId: String): Thr
|
|||||||
|
|
||||||
internal fun ThreadSummaryEntity.Companion.findRootOrLatest(realm: TypedRealm, eventId: String): ThreadSummaryEntity? {
|
internal fun ThreadSummaryEntity.Companion.findRootOrLatest(realm: TypedRealm, eventId: String): ThreadSummaryEntity? {
|
||||||
return realm.query(ThreadSummaryEntity::class)
|
return realm.query(ThreadSummaryEntity::class)
|
||||||
.query("rootThreadEventId == $0 OR latestThreadEventEntity.eventId == $1", eventId, eventId)
|
.query("rootThreadEventId == $0 OR latestThreadEventEntity.eventId == $0", eventId)
|
||||||
.first()
|
.first()
|
||||||
.find()
|
.find()
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ internal class DefaultFinalizeAddingThreePidTask @Inject constructor(
|
|||||||
// Delete the pending three pid
|
// Delete the pending three pid
|
||||||
realmInstance.write {
|
realmInstance.write {
|
||||||
val pendingThreePidEntities = query(PendingThreePidEntity::class)
|
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()
|
.find()
|
||||||
delete(pendingThreePidEntities)
|
delete(pendingThreePidEntities)
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ internal class UserDataSource @Inject constructor(
|
|||||||
query = if (filter.isNullOrEmpty()) {
|
query = if (filter.isNullOrEmpty()) {
|
||||||
query.query("userId != ''")
|
query.query("userId != ''")
|
||||||
} else {
|
} 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
|
excludedUserIds
|
||||||
?.takeIf { it.isNotEmpty() }
|
?.takeIf { it.isNotEmpty() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user