diff --git a/src/LibHac/Common/BlitSpan.cs b/src/LibHac/Common/BlitSpan.cs index d801d95a..5c9d97b2 100644 --- a/src/LibHac/Common/BlitSpan.cs +++ b/src/LibHac/Common/BlitSpan.cs @@ -21,7 +21,7 @@ namespace LibHac.Common /// /// A reference to the first element in this collection. /// - public ref T Value => ref _buffer[0]; + public ref T Value => ref MemoryMarshal.GetReference(_buffer); /// /// A reference to the element at index . @@ -84,8 +84,7 @@ namespace LibHac.Common /// A byte span representation of the element. public Span GetByteSpan(int elementIndex) { - Span element = _buffer.Slice(elementIndex, 1); - return MemoryMarshal.Cast(element); + return SpanHelpers.AsByteSpan(ref _buffer[elementIndex]); } ///