associateWithTo

abstract fun <V, M : MutableMapWrapper<in T, in V>> associateWithTo(destination: M, valueSelector: (T) -> V): M

将序列中的每个元素与其对应的值关联起来,并将结果添加到指定的 MutableMapWrapper 中。

此函数类似于 Kotlin 标准库中的 associateWithTo 函数,但它使用 MutableMapWrapper 而不是原始的 MutableMap

参考 kotlin.sequences.associateWithTo

Return

指定的 MutableMapWrapper,其中包含添加的元素及其对应的值。

Parameters

destination

用于存储结果的 MutableMapWrapper

valueSelector

一个函数,它接收序列的每个元素作为参数,并返回与其关联的值。