Remove bogus filterIsInstance* on strings.
This commit is contained in:
committed by
Andrey Breslav
parent
6562ee4967
commit
9a7758bf4e
@@ -345,13 +345,6 @@ public fun <T, R : T> Stream<T>.filterIsInstance(klass: Class<R>): Stream<T> {
|
|||||||
return FilteringStream(this, true, { klass.isInstance(it) })
|
return FilteringStream(this, true, { klass.isInstance(it) })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list containing all elements that are instances of specified class
|
|
||||||
*/
|
|
||||||
public fun <R : Char> String.filterIsInstance(klass: Class<R>): List<R> {
|
|
||||||
return filterIsInstanceTo(ArrayList<R>(), klass)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends all elements that are instances of specified class to the given *destination*
|
* Appends all elements that are instances of specified class to the given *destination*
|
||||||
*/
|
*/
|
||||||
@@ -376,14 +369,6 @@ public fun <T, C : MutableCollection<in R>, R : T> Stream<T>.filterIsInstanceTo(
|
|||||||
return destination
|
return destination
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Appends all elements that are instances of specified class to the given *destination*
|
|
||||||
*/
|
|
||||||
public fun <C : MutableCollection<in R>, R : Char> String.filterIsInstanceTo(destination: C, klass: Class<R>): C {
|
|
||||||
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
|
|
||||||
return destination
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorts array or range in array inplace
|
* Sorts array or range in array inplace
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ fun specialJVM(): List<GenericFunction> {
|
|||||||
typeParam("C : MutableCollection<in R>")
|
typeParam("C : MutableCollection<in R>")
|
||||||
typeParam("R : T")
|
typeParam("R : T")
|
||||||
returns("C")
|
returns("C")
|
||||||
exclude(ArraysOfPrimitives)
|
exclude(ArraysOfPrimitives, Strings)
|
||||||
body {
|
body {
|
||||||
"""
|
"""
|
||||||
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
|
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
|
||||||
@@ -96,7 +96,7 @@ fun specialJVM(): List<GenericFunction> {
|
|||||||
return filterIsInstanceTo(ArrayList<R>(), klass)
|
return filterIsInstanceTo(ArrayList<R>(), klass)
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
exclude(ArraysOfPrimitives)
|
exclude(ArraysOfPrimitives, Strings)
|
||||||
|
|
||||||
doc(Streams) { "Returns a stream containing all elements that are instances of specified class" }
|
doc(Streams) { "Returns a stream containing all elements that are instances of specified class" }
|
||||||
returns(Streams) { "Stream<T>" }
|
returns(Streams) { "Stream<T>" }
|
||||||
|
|||||||
Reference in New Issue
Block a user