Remove deprecated and not stabilized primitive unsigned iterators

This commit is contained in:
Ilya Gorbunov
2022-04-08 08:01:39 +03:00
committed by Space
parent 4598552e46
commit 2303730d57
11 changed files with 18 additions and 211 deletions
@@ -43,11 +43,10 @@ internal constructor(@PublishedApi internal val storage: ByteArray) : Collection
/** Creates an iterator over the elements of the array. */
public override operator fun iterator(): kotlin.collections.Iterator<UByte> = Iterator(storage)
@Suppress("DEPRECATION_ERROR")
private class Iterator(private val array: ByteArray) : UByteIterator() {
private class Iterator(private val array: ByteArray) : kotlin.collections.Iterator<UByte> {
private var index = 0
override fun hasNext() = index < array.size
override fun nextUByte() = if (index < array.size) array[index++].toUByte() else throw NoSuchElementException(index.toString())
override fun next() = if (index < array.size) array[index++].toUByte() else throw NoSuchElementException(index.toString())
}
override fun contains(element: UByte): Boolean {
@@ -43,11 +43,10 @@ internal constructor(@PublishedApi internal val storage: IntArray) : Collection<
/** Creates an iterator over the elements of the array. */
public override operator fun iterator(): kotlin.collections.Iterator<UInt> = Iterator(storage)
@Suppress("DEPRECATION_ERROR")
private class Iterator(private val array: IntArray) : UIntIterator() {
private class Iterator(private val array: IntArray) : kotlin.collections.Iterator<UInt> {
private var index = 0
override fun hasNext() = index < array.size
override fun nextUInt() = if (index < array.size) array[index++].toUInt() else throw NoSuchElementException(index.toString())
override fun next() = if (index < array.size) array[index++].toUInt() else throw NoSuchElementException(index.toString())
}
override fun contains(element: UInt): Boolean {
@@ -113,8 +113,7 @@ internal constructor(
* @property step the number by which the value is incremented on each step.
*/
@SinceKotlin("1.3")
@Suppress("DEPRECATION_ERROR")
private class UIntProgressionIterator(first: UInt, last: UInt, step: Int) : UIntIterator() {
private class UIntProgressionIterator(first: UInt, last: UInt, step: Int) : Iterator<UInt> {
private val finalElement = last
private var hasNext: Boolean = if (step > 0) first <= last else first >= last
private val step = step.toUInt() // use 2-complement math for negative steps
@@ -122,7 +121,7 @@ private class UIntProgressionIterator(first: UInt, last: UInt, step: Int) : UInt
override fun hasNext(): Boolean = hasNext
override fun nextUInt(): UInt {
override fun next(): UInt {
val value = next
if (value == finalElement) {
if (!hasNext) throw kotlin.NoSuchElementException()
@@ -1,49 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// Auto-generated file. DO NOT EDIT!
package kotlin.collections
/** An iterator over a sequence of values of type `UByte`. */
@Deprecated("This class is not going to be stabilized and is to be removed soon.", level = DeprecationLevel.ERROR)
@SinceKotlin("1.3")
public abstract class UByteIterator : Iterator<UByte> {
final override fun next() = nextUByte()
/** Returns the next value in the sequence without boxing. */
public abstract fun nextUByte(): UByte
}
/** An iterator over a sequence of values of type `UShort`. */
@Deprecated("This class is not going to be stabilized and is to be removed soon.", level = DeprecationLevel.ERROR)
@SinceKotlin("1.3")
public abstract class UShortIterator : Iterator<UShort> {
final override fun next() = nextUShort()
/** Returns the next value in the sequence without boxing. */
public abstract fun nextUShort(): UShort
}
/** An iterator over a sequence of values of type `UInt`. */
@Deprecated("This class is not going to be stabilized and is to be removed soon.", level = DeprecationLevel.ERROR)
@SinceKotlin("1.3")
public abstract class UIntIterator : Iterator<UInt> {
final override fun next() = nextUInt()
/** Returns the next value in the sequence without boxing. */
public abstract fun nextUInt(): UInt
}
/** An iterator over a sequence of values of type `ULong`. */
@Deprecated("This class is not going to be stabilized and is to be removed soon.", level = DeprecationLevel.ERROR)
@SinceKotlin("1.3")
public abstract class ULongIterator : Iterator<ULong> {
final override fun next() = nextULong()
/** Returns the next value in the sequence without boxing. */
public abstract fun nextULong(): ULong
}
@@ -43,11 +43,10 @@ internal constructor(@PublishedApi internal val storage: LongArray) : Collection
/** Creates an iterator over the elements of the array. */
public override operator fun iterator(): kotlin.collections.Iterator<ULong> = Iterator(storage)
@Suppress("DEPRECATION_ERROR")
private class Iterator(private val array: LongArray) : ULongIterator() {
private class Iterator(private val array: LongArray) : kotlin.collections.Iterator<ULong> {
private var index = 0
override fun hasNext() = index < array.size
override fun nextULong() = if (index < array.size) array[index++].toULong() else throw NoSuchElementException(index.toString())
override fun next() = if (index < array.size) array[index++].toULong() else throw NoSuchElementException(index.toString())
}
override fun contains(element: ULong): Boolean {
@@ -113,8 +113,7 @@ internal constructor(
* @property step the number by which the value is incremented on each step.
*/
@SinceKotlin("1.3")
@Suppress("DEPRECATION_ERROR")
private class ULongProgressionIterator(first: ULong, last: ULong, step: Long) : ULongIterator() {
private class ULongProgressionIterator(first: ULong, last: ULong, step: Long) : Iterator<ULong> {
private val finalElement = last
private var hasNext: Boolean = if (step > 0) first <= last else first >= last
private val step = step.toULong() // use 2-complement math for negative steps
@@ -122,7 +121,7 @@ private class ULongProgressionIterator(first: ULong, last: ULong, step: Long) :
override fun hasNext(): Boolean = hasNext
override fun nextULong(): ULong {
override fun next(): ULong {
val value = next
if (value == finalElement) {
if (!hasNext) throw kotlin.NoSuchElementException()
@@ -43,11 +43,10 @@ internal constructor(@PublishedApi internal val storage: ShortArray) : Collectio
/** Creates an iterator over the elements of the array. */
public override operator fun iterator(): kotlin.collections.Iterator<UShort> = Iterator(storage)
@Suppress("DEPRECATION_ERROR")
private class Iterator(private val array: ShortArray) : UShortIterator() {
private class Iterator(private val array: ShortArray) : kotlin.collections.Iterator<UShort> {
private var index = 0
override fun hasNext() = index < array.size
override fun nextUShort() = if (index < array.size) array[index++].toUShort() else throw NoSuchElementException(index.toString())
override fun next() = if (index < array.size) array[index++].toUShort() else throw NoSuchElementException(index.toString())
}
override fun contains(element: UShort): Boolean {