Hi
Thanks for sharing the solution.
Do you have any thoughts or suggestions about the SubArray struct?
To avoid such issues, I could hide SubArray.Array to the public, while providing an indexer:
The issue with this being that SubArray, and the whole array pooling thing, are heavily orientated towards performance. So I prefer to keep the SubArray.Array public to allow for better performance. But I see that it can lead to confusion. I purposely named SubArray.Count that way, instead of Length, to avoid accidentally using the Length of SubArray.Array instead of the one of SubArray.
Anything thoughts?
PS: I will provide that indexer in the next update
Thanks for sharing the solution.
Do you have any thoughts or suggestions about the SubArray struct?
To avoid such issues, I could hide SubArray.Array to the public, while providing an indexer:
Code:
/// <summary>
/// Returns the array element at the given index
/// </summary>
public T this[int index]
{
get => Array[index];
set => Array[index] = value;
}
The issue with this being that SubArray, and the whole array pooling thing, are heavily orientated towards performance. So I prefer to keep the SubArray.Array public to allow for better performance. But I see that it can lead to confusion. I purposely named SubArray.Count that way, instead of Length, to avoid accidentally using the Length of SubArray.Array instead of the one of SubArray.
Anything thoughts?
PS: I will provide that indexer in the next update
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Available for freelance work—feel free to reach out.