Skip to content

IterableOnce#copyToArray uses helper for count [ci: last-only]#10691

Merged
lrytz merged 3 commits intoscala:2.13.xfrom
som-snytt:issue/12948-copy-array
Jun 12, 2025
Merged

IterableOnce#copyToArray uses helper for count [ci: last-only]#10691
lrytz merged 3 commits intoscala:2.13.xfrom
som-snytt:issue/12948-copy-array

Conversation

@som-snytt
Copy link
Copy Markdown
Contributor

@som-snytt som-snytt commented Feb 15, 2024

Don't throw (index out of bounds) when there is no runtime work (destination is zero length or count <= 0).

Audited implementations but did not boost the test coverage much.

Fixes scala/bug#12948

@scala-jenkins scala-jenkins added this to the 2.13.14 milestone Feb 15, 2024
@som-snytt som-snytt changed the title IterableOnce#copyToArray uses helper for count IterableOnce#copyToArray uses helper for count [ci: last-only] Feb 15, 2024
@SethTisue SethTisue added the library:collections PRs involving changes to the standard collection library label Feb 15, 2024
@SethTisue SethTisue modified the milestones: 2.13.14, 2.13.15 Mar 13, 2024
@som-snytt som-snytt closed this Mar 20, 2024
@SethTisue SethTisue removed this from the 2.13.15 milestone Mar 21, 2024
@som-snytt som-snytt reopened this Nov 9, 2024
@scala-jenkins scala-jenkins added this to the 2.13.16 milestone Nov 9, 2024
@SethTisue SethTisue modified the milestones: 2.13.16, 2.13.17 Dec 12, 2024
@som-snytt som-snytt force-pushed the issue/12948-copy-array branch from b4213ef to 8b57370 Compare May 12, 2025 16:27
@som-snytt som-snytt marked this pull request as ready for review May 12, 2025 16:27
@som-snytt som-snytt force-pushed the issue/12948-copy-array branch from 561f109 to e676905 Compare June 5, 2025 16:18
Copy link
Copy Markdown
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

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

Thank you!

@lrytz lrytz merged commit 6a3edf6 into scala:2.13.x Jun 12, 2025
3 of 4 checks passed
@som-snytt som-snytt deleted the issue/12948-copy-array branch June 12, 2025 14:30
hamzaremmal pushed a commit to scala/scala3 that referenced this pull request Sep 24, 2025
…array

IterableOnce#copyToArray uses helper for count [ci: last-only]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

library:collections PRs involving changes to the standard collection library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent copyToArray semantics between IterableOnceOps and Vector (and some other collections).

5 participants