From a5ff0024fb33964c802e1712e5b11a52390603e7 Mon Sep 17 00:00:00 2001 From: gdkchan <gab.dark.100@gmail.com> Date: Thu, 11 Aug 2022 18:07:37 -0300 Subject: Rename ToSpan to AsSpan (#3556) --- Ryujinx.Common/Memory/StructByteArrayHelpers.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Ryujinx.Common/Memory/StructByteArrayHelpers.cs') diff --git a/Ryujinx.Common/Memory/StructByteArrayHelpers.cs b/Ryujinx.Common/Memory/StructByteArrayHelpers.cs index 0c17dc10..8693f5b8 100644 --- a/Ryujinx.Common/Memory/StructByteArrayHelpers.cs +++ b/Ryujinx.Common/Memory/StructByteArrayHelpers.cs @@ -11,8 +11,8 @@ namespace Ryujinx.Common.Memory byte _element; public int Length => Size; - public ref byte this[int index] => ref ToSpan()[index]; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); } [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] @@ -23,8 +23,8 @@ namespace Ryujinx.Common.Memory byte _element; public int Length => Size; - public ref byte this[int index] => ref ToSpan()[index]; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); } [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] @@ -35,8 +35,8 @@ namespace Ryujinx.Common.Memory byte _element; public int Length => Size; - public ref byte this[int index] => ref ToSpan()[index]; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); } [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] @@ -47,8 +47,8 @@ namespace Ryujinx.Common.Memory byte _element; public int Length => Size; - public ref byte this[int index] => ref ToSpan()[index]; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); } [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] @@ -59,8 +59,8 @@ namespace Ryujinx.Common.Memory byte _element; public int Length => Size; - public ref byte this[int index] => ref ToSpan()[index]; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); } [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] @@ -71,7 +71,7 @@ namespace Ryujinx.Common.Memory byte _element; public int Length => Size; - public ref byte this[int index] => ref ToSpan()[index]; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); } } -- cgit v1.2.3-70-g09d2