We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f00431f commit 7a3f8ecCopy full SHA for 7a3f8ec
src/main/scala/scala/collection/decorators/IteratorDecorator.scala
@@ -102,10 +102,9 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal {
102
hd match {
103
case None => Iterator.empty.next()
104
case Some(head) =>
105
- val key = f(head)
106
hd = `this`.nextOption()
107
var seq = mutable.Buffer(head)
108
- while (hd.exists(el => f(el) == key)) {
+ while (hd.exists(el => f(el) == f(head))) {
109
seq = seq ++ hd
110
111
}
0 commit comments