Deprecate mapIndexedTo for Maps.
This commit is contained in:
@@ -52,6 +52,7 @@ public inline fun <K, V, R> Map<K, V>.map(transform: (Map.Entry<K, V>) -> R): Li
|
||||
* Applies the given [transform] function to each entry and its index in the original map
|
||||
* and appends the results to the given [destination].
|
||||
*/
|
||||
@Deprecated("Use entries.mapIndexedTo instead.", ReplaceWith("this.entries.mapIndexedTo(destination, transform)"))
|
||||
public inline fun <K, V, R, C : MutableCollection<in R>> Map<K, V>.mapIndexedTo(destination: C, transform: (Int, Map.Entry<K, V>) -> R): C {
|
||||
var index = 0
|
||||
for (item in this)
|
||||
|
||||
@@ -178,6 +178,7 @@ fun mapping(): List<GenericFunction> {
|
||||
"""
|
||||
}
|
||||
deprecate(Strings) { forBinaryCompatibility }
|
||||
deprecate(Maps) { Deprecation("Use entries.mapIndexedTo instead.", replaceWith = "this.entries.mapIndexedTo(destination, transform)") }
|
||||
include(Maps, CharSequences, Strings)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user