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 {