Skip to content

Replace DelimitedArrayOfT usage with ArraySegment #33#34

Merged
anders9ustafsson merged 1 commit intomainfrom
GH-33
Oct 26, 2025
Merged

Replace DelimitedArrayOfT usage with ArraySegment #33#34
anders9ustafsson merged 1 commit intomainfrom
GH-33

Conversation

@anders9ustafsson
Copy link
Collaborator

No description provided.

@anders9ustafsson anders9ustafsson linked an issue Oct 26, 2025 that may be closed by this pull request
@anders9ustafsson anders9ustafsson self-assigned this Oct 26, 2025
@anders9ustafsson anders9ustafsson added this to the 1.2.1 milestone Oct 26, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the custom DelimitedArray<T> implementation with the built-in ArraySegment<T> type. The custom class was originally created to provide safe array slicing without using unsafe code, but ArraySegment<T> serves the same purpose and is a standard .NET type.

Key changes:

  • Removed the custom DelimitedArray<T> class entirely
  • Updated all usages to use ArraySegment<double> instead
  • Removed the dvec parameter from mp_fdjac2 method and made it a local variable
  • Simplified array segment creation by using ArraySegment<T> constructor directly instead of mutation methods

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/MPFitLib/MPFit.cs Replaced DelimitedArray<double> with ArraySegment<double> throughout; removed dvec parameter from mp_fdjac2 and made it local; replaced mutation methods with direct construction
src/MPFitLib/DelimitedArrayOfT.cs Deleted entire custom DelimitedArray<T> class implementation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anders9ustafsson anders9ustafsson merged commit 0df4e0f into main Oct 26, 2025
1 check passed
@anders9ustafsson anders9ustafsson deleted the GH-33 branch October 26, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace DelimitedArrayOfT with ArraySegment

2 participants