Skip to content

Ensure chunked(by:) always compares consecutive elements#162

Merged
timvermeulen merged 1 commit into
apple:mainfrom
timvermeulen:chunked-by-consecutive-elements
Aug 17, 2021
Merged

Ensure chunked(by:) always compares consecutive elements#162
timvermeulen merged 1 commit into
apple:mainfrom
timvermeulen:chunked-by-consecutive-elements

Conversation

@timvermeulen
Copy link
Copy Markdown
Contributor

Fixes #161.

[a, b, c, d].chunked(by: { print($0, $1); return true })
// previous behavior: (a, b), (a, c), (a, d)
// correct behavior:  (a, b), (b, c), (c, d)

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

@timvermeulen
Copy link
Copy Markdown
Contributor Author

@swift-ci Please test

@timvermeulen timvermeulen merged commit 9f62800 into apple:main Aug 17, 2021
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.

Chunked(by:) behavior seems incompatible with its documentation.

2 participants