diff --git a/gradle.properties b/gradle.properties index e21ab54..e6b6a24 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=3.9.0 +projectVersion=3.9.1 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/collect/StreamyIterators.kt b/src/main/kotlin/ru/dbotthepony/kommons/collect/StreamyIterators.kt index aa8063b..2d8baa2 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/collect/StreamyIterators.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/collect/StreamyIterators.kt @@ -2,6 +2,7 @@ package ru.dbotthepony.kommons.collect import ru.dbotthepony.kommons.util.KOptional import java.util.* +import java.util.Collections.emptyIterator import java.util.NoSuchElementException import java.util.function.Predicate import java.util.stream.Collector @@ -377,24 +378,6 @@ fun Iterator.maybe(): T? { null } -private object EmptyIterator : MutableIterator { - override fun hasNext(): Boolean { - return false - } - - override fun next(): Nothing { - throw NoSuchElementException() - } - - override fun remove() { - throw NoSuchElementException() - } -} - -fun emptyIterator(): MutableIterator { - return EmptyIterator as MutableIterator -} - fun iteratorOf(value: T): Iterator { return object : Iterator { private var next = true