Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review of ArrayTools to use Span, documentation, attributes #9

Open
dzmitry-lahoda opened this issue Jul 26, 2018 · 0 comments
Open

Comments

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Jul 26, 2018

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

public static class ArrayTools

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 in some future version?

Doc

Methods to work with immutable arrays replace with Methods to work with arrays as immutable

/// <summary>Methods to work with immutable arrays, and general array sugar.</summary>

Attributes

Consider something existing which on arrays:

        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
        public static int BinarySearch<T>(T[] array, int index, int length, T value, IComparer<T> comparer);

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

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

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

No branches or pull requests

1 participant