Clean after benoit's review

This commit is contained in:
ganfra 2019-10-07 14:45:58 +02:00
parent 77de059dc9
commit 8e39fd2a70
2 changed files with 4 additions and 4 deletions

View file

@ -43,7 +43,7 @@ fun <T> doWithRealm(realmConfiguration: RealmConfiguration, action: (Realm) -> T
fun <T : RealmObject> doRealmQueryAndCopy(realmConfiguration: RealmConfiguration, action: (Realm) -> T?): T? {
return Realm.getInstance(realmConfiguration).use { realm ->
val result = action.invoke(realm)
result?.let { realm.copyFromRealm(result) }
result?.let { realm.copyFromRealm(it) }
}
}
@ -53,7 +53,7 @@ fun <T : RealmObject> doRealmQueryAndCopy(realmConfiguration: RealmConfiguration
fun <T : RealmObject> doRealmQueryAndCopyList(realmConfiguration: RealmConfiguration, action: (Realm) -> Iterable<T>): Iterable<T> {
return Realm.getInstance(realmConfiguration).use { realm ->
val result = action.invoke(realm)
return realm.copyFromRealm(result)
realm.copyFromRealm(result)
}
}

View file

@ -33,7 +33,7 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava
fun create(text: String,
informationData: MessageInformationData,
highlight: Boolean,
callback: TimelineEventController.Callback?): DefaultItem? {
callback: TimelineEventController.Callback?): DefaultItem {
return DefaultItem_()
.leftGuideline(avatarSizeProvider.leftGuideline)
@ -49,7 +49,7 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava
highlight: Boolean,
readMarkerVisible: Boolean,
callback: TimelineEventController.Callback?,
exception: Exception? = null): DefaultItem? {
exception: Exception? = null): DefaultItem {
val text = if (exception == null) {
"${event.root.getClearType()} events are not yet handled"
} else {