Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@YuvalItzchakov
Copy link
Contributor

@YuvalItzchakov YuvalItzchakov commented Jul 14, 2020

Fixes #3968

Small bug in Chunk.foldWhileM iterates the iterable twice while only checking once:

if (iterator.hasNext) {
  val array  = iterator.next()
  val length = array.length
  loop(z, iterator, iterator.next(), 0, length)
} else {
  ZIO.succeedNow(z)
}

@CLAassistant
Copy link

CLAassistant commented Jul 14, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@adamgfraser adamgfraser merged commit 8551ae7 into zio:master Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chunk.foldWhileM explodes due to multiple iterations

3 participants