org.gorttar.data.SequenceEquality.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of handy-libs Show documentation
Show all versions of handy-libs Show documentation
Bunch of somewhat usable libraries without any particular direction
package org.gorttar.data
infix fun Sequence<*>.eq(ySequence: Sequence<*>): Boolean {
val xs = iterator()
val ys = ySequence.iterator()
while (xs.hasNext() || ys.hasNext()) if (!xs.hasNext() || !ys.hasNext() || xs.next() != ys.next()) return false
return true
}