mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Merge pull request #1168 from vladimirov001/kotlin_verify_error_on_android_kitkat_devices
R8 triggers VerifyError on KitKat devices
This commit is contained in:
@@ -156,14 +156,16 @@ internal class KotlinJsonAdapter<T>(
|
|||||||
class IndexedParameterMap(
|
class IndexedParameterMap(
|
||||||
private val parameterKeys: List<KParameter>,
|
private val parameterKeys: List<KParameter>,
|
||||||
private val parameterValues: Array<Any?>
|
private val parameterValues: Array<Any?>
|
||||||
) : AbstractMap<KParameter, Any?>() {
|
) : AbstractMutableMap<KParameter, Any?>() {
|
||||||
|
|
||||||
override val entries: Set<Entry<KParameter, Any?>>
|
override fun put(key: KParameter, value: Any?): Any? = null
|
||||||
|
|
||||||
|
override val entries: MutableSet<MutableMap.MutableEntry<KParameter, Any?>>
|
||||||
get() {
|
get() {
|
||||||
val allPossibleEntries = parameterKeys.mapIndexed { index, value ->
|
val allPossibleEntries = parameterKeys.mapIndexed { index, value ->
|
||||||
SimpleEntry<KParameter, Any?>(value, parameterValues[index])
|
SimpleEntry<KParameter, Any?>(value, parameterValues[index])
|
||||||
}
|
}
|
||||||
return allPossibleEntries.filterTo(LinkedHashSet<Entry<KParameter, Any?>>()) {
|
return allPossibleEntries.filterTo(mutableSetOf()) {
|
||||||
it.value !== ABSENT_VALUE
|
it.value !== ABSENT_VALUE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user