mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
use improt alias to enforce use of kotlin map function
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
b5a379bc50
commit
bb6cb228a7
@ -31,6 +31,7 @@ import com.nextcloud.talk.polls.repositories.model.PollResponse
|
|||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
|
import kotlin.collections.forEach as kForEach
|
||||||
|
|
||||||
class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvider: CurrentUserProviderNew) :
|
class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvider: CurrentUserProviderNew) :
|
||||||
PollRepository {
|
PollRepository {
|
||||||
@ -120,7 +121,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
|
|||||||
|
|
||||||
private fun convertVotes(votes: Map<String, Int>?): Map<String, Int> {
|
private fun convertVotes(votes: Map<String, Int>?): Map<String, Int> {
|
||||||
val resultMap: MutableMap<String, Int> = HashMap()
|
val resultMap: MutableMap<String, Int> = HashMap()
|
||||||
votes?.forEach { (key, value) ->
|
votes?.kForEach { (key, value) ->
|
||||||
resultMap[key.replace("option-", "")] = value
|
resultMap[key.replace("option-", "")] = value
|
||||||
}
|
}
|
||||||
return resultMap
|
return resultMap
|
||||||
|
Loading…
Reference in New Issue
Block a user