Rename ToSpan to AsSpan (#3556)
This commit is contained in:
parent
f9661a54d2
commit
a5ff0024fb
44 changed files with 281 additions and 281 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue