Temporary drop mapNotNull and mapNotNullTo.

Disable mapNotNull tests

#KT-4410
This commit is contained in:
Ilya Gorbunov
2015-10-30 17:14:04 +03:00
parent b71fec985f
commit 65a98d6968
6 changed files with 8 additions and 66 deletions
-22
View File
@@ -6545,28 +6545,6 @@ public inline fun <R, C : MutableCollection<in R>> ShortArray.mapIndexedTo(desti
return destination
}
/**
* Returns a list containing the results of applying the given [transform] function to each non-null element of the original collection.
*/
@Deprecated("This function will change its semantics soon to map&filter rather than filter&map. Use filterNotNull().map {} instead.", ReplaceWith("filterNotNull().map(transform)"))
public inline fun <T : Any, R> Array<out T?>.mapNotNull(transform: (T) -> R): List<R> {
return mapNotNullTo(ArrayList<R>(), transform)
}
/**
* Appends transformed non-null elements of original collection using the given [transform] function
* to the given [destination].
*/
@Deprecated("This function will change its semantics soon to map&filter rather than filter&map. Use filterNotNull().mapTo(destination) {} instead.", ReplaceWith("filterNotNull().mapTo(destination, transform)"))
public inline fun <T : Any, R, C : MutableCollection<in R>> Array<out T?>.mapNotNullTo(destination: C, transform: (T) -> R): C {
for (element in this) {
if (element != null) {
destination.add(transform(element))
}
}
return destination
}
/**
* Appends transformed elements of the original collection using the given [transform] function
* to the given [destination].
@@ -1081,28 +1081,6 @@ public inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.mapIndexedTo(d
return destination
}
/**
* Returns a list containing the results of applying the given [transform] function to each non-null element of the original collection.
*/
@Deprecated("This function will change its semantics soon to map&filter rather than filter&map. Use filterNotNull().map {} instead.", ReplaceWith("filterNotNull().map(transform)"))
public inline fun <T : Any, R> Iterable<T?>.mapNotNull(transform: (T) -> R): List<R> {
return mapNotNullTo(ArrayList<R>(), transform)
}
/**
* Appends transformed non-null elements of original collection using the given [transform] function
* to the given [destination].
*/
@Deprecated("This function will change its semantics soon to map&filter rather than filter&map. Use filterNotNull().mapTo(destination) {} instead.", ReplaceWith("filterNotNull().mapTo(destination, transform)"))
public inline fun <T : Any, R, C : MutableCollection<in R>> Iterable<T?>.mapNotNullTo(destination: C, transform: (T) -> R): C {
for (element in this) {
if (element != null) {
destination.add(transform(element))
}
}
return destination
}
/**
* Appends transformed elements of the original collection using the given [transform] function
* to the given [destination].
@@ -606,28 +606,6 @@ public inline fun <T, R, C : MutableCollection<in R>> Sequence<T>.mapIndexedTo(d
return destination
}
/**
* Returns a sequence containing the results of applying the given [transform] function to each non-null element of the original sequence.
*/
@Deprecated("This function will change its semantics soon to map&filter rather than filter&map. Use filterNotNull().map {} instead.", ReplaceWith("filterNotNull().map(transform)"))
public fun <T : Any, R> Sequence<T?>.mapNotNull(transform: (T) -> R): Sequence<R> {
return TransformingSequence(FilteringSequence(this, false, { it == null }) as Sequence<T>, transform)
}
/**
* Appends transformed non-null elements of original collection using the given [transform] function
* to the given [destination].
*/
@Deprecated("This function will change its semantics soon to map&filter rather than filter&map. Use filterNotNull().mapTo(destination) {} instead.", ReplaceWith("filterNotNull().mapTo(destination, transform)"))
public inline fun <T : Any, R, C : MutableCollection<in R>> Sequence<T?>.mapNotNullTo(destination: C, transform: (T) -> R): C {
for (element in this) {
if (element != null) {
destination.add(transform(element))
}
}
return destination
}
/**
* Appends transformed elements of the original collection using the given [transform] function
* to the given [destination].