Fix a few Kotlin style issues
This commit is contained in:
parent
31cffa68c5
commit
a48529872d
|
@ -50,7 +50,7 @@ class FeedDatabaseManager(context: Context) {
|
|||
|
||||
return streams.map<List<StreamInfoItem>> {
|
||||
val items = ArrayList<StreamInfoItem>(it.size)
|
||||
for (streamEntity in it) items.add(streamEntity.toStreamInfoItem())
|
||||
it.mapTo(items) { it.toStreamInfoItem() }
|
||||
return@map items
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,8 +161,8 @@ class FeedLoadService : Service() {
|
|||
companion object {
|
||||
fun wrapList(subscriptionId: Long, info: ListInfo<StreamInfoItem>): List<Throwable> {
|
||||
val toReturn = ArrayList<Throwable>(info.errors.size)
|
||||
for (error in info.errors) {
|
||||
toReturn.add(RequestException(subscriptionId, info.serviceId.toString() + ":" + info.url, error))
|
||||
info.errors.mapTo(toReturn) {
|
||||
RequestException(subscriptionId, info.serviceId.toString() + ":" + info.url, it)
|
||||
}
|
||||
return toReturn
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ class FeedGroupDialogViewModel(
|
|||
BiFunction { t1: String, t2: Boolean -> Filter(t1, t2) }
|
||||
)
|
||||
.distinctUntilChanged()
|
||||
.switchMap { filter ->
|
||||
subscriptionManager.getSubscriptions(groupId, filter.query, filter.showOnlyUngrouped)
|
||||
.switchMap { (query, showOnlyUngrouped) ->
|
||||
subscriptionManager.getSubscriptions(groupId, query, showOnlyUngrouped)
|
||||
}.map { list -> list.map { PickerSubscriptionItem(it) } }
|
||||
|
||||
private val mutableGroupLiveData = MutableLiveData<FeedGroupEntity>()
|
||||
|
|
Loading…
Reference in New Issue