@@ -550,6 +550,8 @@ public operator fun LongArray.contains(element: Long): Boolean {
/**
* Returns `true` if [element] is found in the array.
*/
@Deprecated("The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'any { it == element }' instead to continue using this behavior, or '.asList().contains(element: T)' to get the same search behavior as in a list.", ReplaceWith("any { it == element }"))
@Suppress("DEPRECATION")
public operator fun FloatArray.contains(element: Float): Boolean {
return indexOf(element) >= 0
}
...
...
@@ -557,6 +559,8 @@ public operator fun FloatArray.contains(element: Float): Boolean {
/**
* Returns `true` if [element] is found in the array.
*/
@Deprecated("The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'any { it == element }' instead to continue using this behavior, or '.asList().contains(element: T)' to get the same search behavior as in a list.", ReplaceWith("any { it == element }"))
@Suppress("DEPRECATION")
public operator fun DoubleArray.contains(element: Double): Boolean {
return indexOf(element) >= 0
}
...
...
@@ -1474,6 +1478,7 @@ public fun LongArray.indexOf(element: Long): Int {
/**
* Returns first index of [element], or -1 if the array does not contain element.
*/
@Deprecated("The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfFirst { it == element }' instead to continue using this behavior, or '.asList().indexOf(element: T)' to get the same search behavior as in a list.", ReplaceWith("indexOfFirst { it == element }"))
public fun FloatArray.indexOf(element: Float): Int {
for (index in indices) {
if (element == this[index]) {
...
...
@@ -1486,6 +1491,7 @@ public fun FloatArray.indexOf(element: Float): Int {
/**
* Returns first index of [element], or -1 if the array does not contain element.
*/
@Deprecated("The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfFirst { it == element }' instead to continue using this behavior, or '.asList().indexOf(element: T)' to get the same search behavior as in a list.", ReplaceWith("indexOfFirst { it == element }"))
public fun DoubleArray.indexOf(element: Double): Int {
for (index in indices) {
if (element == this[index]) {
...
...
@@ -2004,6 +2010,7 @@ public fun LongArray.lastIndexOf(element: Long): Int {
/**
* Returns last index of [element], or -1 if the array does not contain element.
*/
@Deprecated("The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfLast { it == element }' instead to continue using this behavior, or '.asList().lastIndexOf(element: T)' to get the same search behavior as in a list.", ReplaceWith("indexOfLast { it == element }"))
public fun FloatArray.lastIndexOf(element: Float): Int {
for (index in indices.reversed()) {
if (element == this[index]) {
...
...
@@ -2016,6 +2023,7 @@ public fun FloatArray.lastIndexOf(element: Float): Int {
/**
* Returns last index of [element], or -1 if the array does not contain element.
*/
@Deprecated("The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfLast { it == element }' instead to continue using this behavior, or '.asList().lastIndexOf(element: T)' to get the same search behavior as in a list.", ReplaceWith("indexOfLast { it == element }"))
public fun DoubleArray.lastIndexOf(element: Double): Int {
return"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use '$replacement' instead to continue using this behavior, or '.asList().$signature' to get the same search behavior as in a list."