Advance deprecation level of Float/DoubleArray contains, indexOf, lastIndexOf to ERROR #KT-28753

This commit is contained in:
Abduqodiri Qurbonzoda
2021-09-13 17:32:17 +03:00
parent 3ddc29363a
commit bde055fe5c
5 changed files with 25 additions and 25 deletions
@@ -551,8 +551,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 }"))
@DeprecatedSinceKotlin(warningSince = "1.4")
@Suppress("DEPRECATION")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
@Suppress("DEPRECATION_ERROR")
public operator fun FloatArray.contains(element: Float): Boolean {
return indexOf(element) >= 0
}
@@ -561,8 +561,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 }"))
@DeprecatedSinceKotlin(warningSince = "1.4")
@Suppress("DEPRECATION")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
@Suppress("DEPRECATION_ERROR")
public operator fun DoubleArray.contains(element: Double): Boolean {
return indexOf(element) >= 0
}
@@ -1565,7 +1565,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 }"))
@DeprecatedSinceKotlin(warningSince = "1.4")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
public fun FloatArray.indexOf(element: Float): Int {
for (index in indices) {
if (element == this[index]) {
@@ -1579,7 +1579,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 }"))
@DeprecatedSinceKotlin(warningSince = "1.4")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
public fun DoubleArray.indexOf(element: Double): Int {
for (index in indices) {
if (element == this[index]) {
@@ -2153,7 +2153,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 }"))
@DeprecatedSinceKotlin(warningSince = "1.4")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
public fun FloatArray.lastIndexOf(element: Float): Int {
for (index in indices.reversed()) {
if (element == this[index]) {
@@ -2167,7 +2167,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 }"))
@DeprecatedSinceKotlin(warningSince = "1.4")
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
public fun DoubleArray.lastIndexOf(element: Double): Int {
for (index in indices.reversed()) {
if (element == this[index]) {