Skip to content

Conversation

@muqiuhan
Copy link
Contributor

@muqiuhan muqiuhan commented Mar 3, 2025

Description

Use array.Clone() to fix the bug that Array.insertManyAt directly returning source array when the values inserted are empty.

Checklist

  • Test cases added
  • Performance benchmarks added in case of performance changes
  • Release notes entry updated

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/FSharp.Core docs/release-notes/.FSharp.Core/9.0.300.md

@psfinaki
Copy link
Contributor

psfinaki commented Mar 3, 2025

Hi @muqiuhan - thanks for the contribution. Could you please add a test for the fix?

@muqiuhan
Copy link
Contributor Author

muqiuhan commented Mar 3, 2025 via email

@albert-du
Copy link
Contributor

👍

Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Alrighty, I think this is the right fix.

Please add release notes and optionally a comment for the change, referencing the issue.

Thanks!

@KevinRansom
Copy link
Contributor

KevinRansom commented Mar 4, 2025

In my heart, this isn't a bug, inserting an empty array into an array should not result in a copy, however, both append and concat with empty arrays do, and so I must reluctantly approve.
Array.append [||]
image

Array.concat [||]
image

…ion (dotnet#18352)

- Update test, release note and comment for Array.InsertManyAt
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Mar 10, 2025
@psfinaki
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki
Copy link
Contributor

/azp run

@psfinaki psfinaki enabled auto-merge (squash) March 10, 2025 12:48
@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki psfinaki merged commit 7cb2cea into dotnet:main Mar 10, 2025
33 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Array.insertManyAt returns original array for empty insertion

5 participants