dadhi / dadhi/ImTools

Review of ArrayTools to use Span, documentation, attributes

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
251
Forks
11
PR merge metrics
No merged PRs in 30d

Description

# Span
As I understand ArrayTools consider arrays as immutable(while .NET devs have build Spans for arrays to be really immutable), may try to apply
https://github.com/dadhi/ImTools/blob/56b7f53a784c3843e4299658592d7b9340153fbc/src/ImTools/ImTools.cs#L48
https://msdn.microsoft.com/en-us/magazine/mt814808.aspx?f=255&MSPPError=-2147217396
(these are only couple percentage slower)

Would you accept migration to [Span](https://www.nuget.org/packages/System.Memory/) in some future version?

# Doc
`Methods to work with immutable arrays` replace with `Methods to work with arrays as immutable`
https://github.com/dadhi/ImTools/blob/56b7f53a784c3843e4299658592d7b9340153fbc/src/ImTools/ImTools.cs#L47

# Attributes
Consider something existing which on arrays:
```
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public static int BinarySearch(T[] array, int index, int length, T value, IComparer comparer);

[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
[SecuritySafeCritical]
public static int LastIndexOf(Array array, object value, int startIndex, int count);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlyMemory Slice(int start)

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/ImTools/ImTools.cs around lines 47-48, then read the linked ImTools implementation and System.Memory/Span references. Determine whether Span-based APIs and the suggested attributes are in scope, and review the wording change for immutable-array methods. Done should mean an agreed scope and corresponding API, documentation, or attribute updates, but the issue does not name tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.