mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Slightly change some BlitSpan methods
This commit is contained in:
parent
be2c4d3959
commit
a7c733f96c
1 changed files with 2 additions and 3 deletions
|
@ -21,7 +21,7 @@ namespace LibHac.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference to the first element in this collection.
|
/// A reference to the first element in this collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ref T Value => ref _buffer[0];
|
public ref T Value => ref MemoryMarshal.GetReference(_buffer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference to the element at index <paramref name="index"/>.
|
/// A reference to the element at index <paramref name="index"/>.
|
||||||
|
@ -84,8 +84,7 @@ namespace LibHac.Common
|
||||||
/// <returns>A byte span representation of the element.</returns>
|
/// <returns>A byte span representation of the element.</returns>
|
||||||
public Span<byte> GetByteSpan(int elementIndex)
|
public Span<byte> GetByteSpan(int elementIndex)
|
||||||
{
|
{
|
||||||
Span<T> element = _buffer.Slice(elementIndex, 1);
|
return SpanHelpers.AsByteSpan(ref _buffer[elementIndex]);
|
||||||
return MemoryMarshal.Cast<T, byte>(element);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue