Drop deprecated mapIndexedTo on Maps.
This commit is contained in:
@@ -49,18 +49,6 @@ public inline fun <K, V, R> Map<K, V>.map(transform: (Map.Entry<K, V>) -> R): Li
|
|||||||
return mapTo(ArrayList<R>(size), transform)
|
return mapTo(ArrayList<R>(size), transform)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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)
|
|
||||||
destination.add(transform(index++, item))
|
|
||||||
return destination
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list containing only the non-null results of applying the given [transform] function
|
* Returns a list containing only the non-null results of applying the given [transform] function
|
||||||
* to each entry in the original map.
|
* to each entry in the original map.
|
||||||
|
|||||||
@@ -170,8 +170,7 @@ fun mapping(): List<GenericFunction> {
|
|||||||
return destination
|
return destination
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
deprecate(Maps) { Deprecation("Use entries.mapIndexedTo instead.", replaceWith = "this.entries.mapIndexedTo(destination, transform)") }
|
include(CharSequences)
|
||||||
include(Maps, CharSequences)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
templates add f("mapNotNullTo(destination: C, transform: (T) -> R?)") {
|
templates add f("mapNotNullTo(destination: C, transform: (T) -> R?)") {
|
||||||
|
|||||||
Reference in New Issue
Block a user