diff options
author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-06-28 18:41:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 18:41:38 +0200 |
commit | fc20d9b925b83532a19467293a7cdcbaa4ef3d6b (patch) | |
tree | ebe0e690b6644d0f825ee80f20e4067855f35cf4 /src/Ryujinx.Common/Memory/StructArrayHelpers.cs | |
parent | 0a75b73fa43ddadf561ddeb0f923c6f3811c025b (diff) |
[Ryujinx.Common] Address dotnet-format issues (#5358)1.1.936
* dotnet format style --severity info
Some changes were manually reverted.
* dotnet format analyzers --serverity info
Some changes have been minimally adapted.
* Restore a few unused methods and variables
* Silence dotnet format IDE0060 warnings
* Silence dotnet format IDE0059 warnings
* Address or silence dotnet format IDE1006 warnings
* Address dotnet format CA1816 warnings
* Address or silence dotnet format CA2211 warnings
* Silence CA1806 and CA1834 issues
* Fix formatting for switch expressions
* Address most dotnet format whitespace warnings
* Apply dotnet format whitespace formatting
A few of them have been manually reverted and the corresponding warning was silenced
* Revert formatting changes for while and for-loops
* Format if-blocks correctly
* Run dotnet format whitespace after rebase
* Run dotnet format style after rebase
* Run dotnet format analyzers after rebase
* Run dotnet format after rebase and remove unused usings
- analyzers
- style
- whitespace
* Add comments to disabled warnings
* Remove a few unused parameters
* Replace MmeShadowScratch with Array256<uint>
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Run dotnet format after rebase
* Address IDE0251 warnings
* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"
This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.
* dotnet format whitespace after rebase
* First dotnet format pass
* Second dotnet format pass
* Fix build issues
* Fix StructArrayHelpers.cs
* Apply suggestions from code review
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Fix return statements
* Fix naming rule violations
* Update src/Ryujinx.Common/Utilities/StreamUtils.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Add trailing commas
* Address review feedback
* Address review feedback
* Rename remaining type parameters to TKey and TValue
* Fix manual formatting for logging levels
* Fix spacing before comments
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Common/Memory/StructArrayHelpers.cs')
-rw-r--r-- | src/Ryujinx.Common/Memory/StructArrayHelpers.cs | 520 |
1 files changed, 262 insertions, 258 deletions
diff --git a/src/Ryujinx.Common/Memory/StructArrayHelpers.cs b/src/Ryujinx.Common/Memory/StructArrayHelpers.cs index a039d04e..ae5853d1 100644 --- a/src/Ryujinx.Common/Memory/StructArrayHelpers.cs +++ b/src/Ryujinx.Common/Memory/StructArrayHelpers.cs @@ -1,654 +1,658 @@ using System; using System.Runtime.InteropServices; +#pragma warning disable CS0169, IDE0051 // Remove unused private member namespace Ryujinx.Common.Memory { public struct Array1<T> : IArray<T> where T : unmanaged { T _e0; - public int Length => 1; + public readonly int Length => 1; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 1); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array2<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array1<T> _other; -#pragma warning restore CS0169 - public int Length => 2; + public readonly int Length => 2; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 2); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array3<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array2<T> _other; -#pragma warning restore CS0169 - public int Length => 3; + public readonly int Length => 3; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 3); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array4<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array3<T> _other; -#pragma warning restore CS0169 - public int Length => 4; + public readonly int Length => 4; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 4); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array5<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array4<T> _other; -#pragma warning restore CS0169 - public int Length => 5; + public readonly int Length => 5; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 5); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array6<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array5<T> _other; -#pragma warning restore CS0169 - public int Length => 6; + public readonly int Length => 6; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 6); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array7<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array6<T> _other; -#pragma warning restore CS0169 - public int Length => 7; + public readonly int Length => 7; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 7); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array8<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array7<T> _other; -#pragma warning restore CS0169 - public int Length => 8; + public readonly int Length => 8; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 8); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array9<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array8<T> _other; -#pragma warning restore CS0169 - public int Length => 9; + public readonly int Length => 9; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 9); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array10<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array9<T> _other; -#pragma warning restore CS0169 - public int Length => 10; + public readonly int Length => 10; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 10); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array11<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array10<T> _other; -#pragma warning restore CS0169 - public int Length => 11; + public readonly int Length => 11; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 11); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array12<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array11<T> _other; -#pragma warning restore CS0169 - public int Length => 12; + public readonly int Length => 12; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 12); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array13<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array12<T> _other; -#pragma warning restore CS0169 - public int Length => 13; + public readonly int Length => 13; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 13); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array14<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array13<T> _other; -#pragma warning restore CS0169 - public int Length => 14; + public readonly int Length => 14; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 14); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array15<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array14<T> _other; -#pragma warning restore CS0169 - public int Length => 15; + public readonly int Length => 15; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 15); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array16<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array15<T> _other; -#pragma warning restore CS0169 - public int Length => 16; + public readonly int Length => 16; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 16); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array17<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array16<T> _other; -#pragma warning restore CS0169 - public int Length => 17; + public readonly int Length => 17; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 17); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array18<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array17<T> _other; -#pragma warning restore CS0169 - public int Length => 18; + public readonly int Length => 18; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 18); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array19<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array18<T> _other; -#pragma warning restore CS0169 - public int Length => 19; + public readonly int Length => 19; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 19); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array20<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array19<T> _other; -#pragma warning restore CS0169 - public int Length => 20; + public readonly int Length => 20; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 20); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array21<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array20<T> _other; -#pragma warning restore CS0169 - public int Length => 21; + public readonly int Length => 21; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 21); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array22<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array21<T> _other; -#pragma warning restore CS0169 - public int Length => 22; + public readonly int Length => 22; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 22); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array23<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array22<T> _other; -#pragma warning restore CS0169 - public int Length => 23; + public readonly int Length => 23; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 23); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array24<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array23<T> _other; -#pragma warning restore CS0169 - public int Length => 24; + + public readonly int Length => 24; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 24); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array25<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array24<T> _other; -#pragma warning restore CS0169 - public int Length => 25; + + public readonly int Length => 25; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 25); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array26<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array25<T> _other; -#pragma warning restore CS0169 - public int Length => 26; + + public readonly int Length => 26; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 26); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array27<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array26<T> _other; -#pragma warning restore CS0169 - public int Length => 27; + + public readonly int Length => 27; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 27); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array28<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array27<T> _other; -#pragma warning restore CS0169 - public int Length => 28; + + public readonly int Length => 28; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 28); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array29<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array28<T> _other; -#pragma warning restore CS0169 - public int Length => 29; + + public readonly int Length => 29; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 29); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array30<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array29<T> _other; -#pragma warning restore CS0169 - public int Length => 30; + + public readonly int Length => 30; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 30); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array31<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array30<T> _other; -#pragma warning restore CS0169 - public int Length => 31; + + public readonly int Length => 31; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 31); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array32<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array31<T> _other; -#pragma warning restore CS0169 - public int Length => 32; + + public readonly int Length => 32; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 32); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array33<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array32<T> _other; -#pragma warning restore CS0169 - public int Length => 33; + + public readonly int Length => 33; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 33); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array34<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array33<T> _other; -#pragma warning restore CS0169 - public int Length => 34; + + public readonly int Length => 34; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 34); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array35<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array34<T> _other; -#pragma warning restore CS0169 - public int Length => 35; + + public readonly int Length => 35; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 35); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array36<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array35<T> _other; -#pragma warning restore CS0169 - public int Length => 36; + + public readonly int Length => 36; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 36); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array37<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array36<T> _other; -#pragma warning restore CS0169 - public int Length => 37; + + public readonly int Length => 37; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 37); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array38<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array37<T> _other; -#pragma warning restore CS0169 - public int Length => 38; + + public readonly int Length => 38; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 38); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array39<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array38<T> _other; -#pragma warning restore CS0169 - public int Length => 39; + + public readonly int Length => 39; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 39); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array40<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array39<T> _other; -#pragma warning restore CS0169 - public int Length => 40; + + public readonly int Length => 40; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 40); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array41<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array40<T> _other; -#pragma warning restore CS0169 - public int Length => 41; + + public readonly int Length => 41; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 41); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array42<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array41<T> _other; -#pragma warning restore CS0169 - public int Length => 42; + + public readonly int Length => 42; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 42); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array43<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array42<T> _other; -#pragma warning restore CS0169 - public int Length => 43; + + public readonly int Length => 43; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 43); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array44<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array43<T> _other; -#pragma warning restore CS0169 - public int Length => 44; + + public readonly int Length => 44; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 44); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array45<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array44<T> _other; -#pragma warning restore CS0169 - public int Length => 45; + + public readonly int Length => 45; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 45); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array46<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array45<T> _other; -#pragma warning restore CS0169 - public int Length => 46; + + public readonly int Length => 46; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 46); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array47<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array46<T> _other; -#pragma warning restore CS0169 - public int Length => 47; + + public readonly int Length => 47; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 47); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array48<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array47<T> _other; -#pragma warning restore CS0169 - public int Length => 48; + + public readonly int Length => 48; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 48); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array49<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array48<T> _other; -#pragma warning restore CS0169 - public int Length => 49; + + public readonly int Length => 49; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 49); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array50<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array49<T> _other; -#pragma warning restore CS0169 - public int Length => 50; + + public readonly int Length => 50; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 50); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array51<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array50<T> _other; -#pragma warning restore CS0169 - public int Length => 51; + + public readonly int Length => 51; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 51); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array52<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array51<T> _other; -#pragma warning restore CS0169 - public int Length => 52; + + public readonly int Length => 52; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 52); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array53<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array52<T> _other; -#pragma warning restore CS0169 - public int Length => 53; + + public readonly int Length => 53; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 53); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array54<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array53<T> _other; -#pragma warning restore CS0169 - public int Length => 54; + + public readonly int Length => 54; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 54); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array55<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array54<T> _other; -#pragma warning restore CS0169 - public int Length => 55; + + public readonly int Length => 55; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 55); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array56<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array55<T> _other; -#pragma warning restore CS0169 - public int Length => 56; + + public readonly int Length => 56; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 56); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array57<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array56<T> _other; -#pragma warning restore CS0169 - public int Length => 57; + + public readonly int Length => 57; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 57); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array58<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array57<T> _other; -#pragma warning restore CS0169 - public int Length => 58; + + public readonly int Length => 58; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 58); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array59<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array58<T> _other; -#pragma warning restore CS0169 - public int Length => 59; + + public readonly int Length => 59; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 59); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array60<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array59<T> _other; -#pragma warning restore CS0169 - public int Length => 60; + public readonly int Length => 60; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 60); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array61<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array60<T> _other; -#pragma warning restore CS0169 - public int Length => 61; + public readonly int Length => 61; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 61); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array62<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array61<T> _other; -#pragma warning restore CS0169 - public int Length => 62; + public readonly int Length => 62; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 62); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array63<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array62<T> _other; -#pragma warning restore CS0169 - public int Length => 63; + public readonly int Length => 63; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 63); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array64<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array63<T> _other; -#pragma warning restore CS0169 - public int Length => 64; + public readonly int Length => 64; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 64); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array73<T> : IArray<T> where T : unmanaged { -#pragma warning disable CS0169 T _e0; Array64<T> _other; Array8<T> _other2; -#pragma warning restore CS0169 - public int Length => 73; + public readonly int Length => 73; + public ref T this[int index] => ref AsSpan()[index]; + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); + } + + public struct Array127<T> : IArray<T> where T : unmanaged + { + T _e0; + Array64<T> _other; + Array62<T> _other2; + public readonly int Length => 127; + public ref T this[int index] => ref AsSpan()[index]; + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); + } + + public struct Array128<T> : IArray<T> where T : unmanaged + { + T _e0; + Array64<T> _other; + Array63<T> _other2; + public readonly int Length => 128; + public ref T this[int index] => ref AsSpan()[index]; + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); + } + + public struct Array256<T> : IArray<T> where T : unmanaged + { + T _e0; + Array128<T> _other; + Array127<T> _other2; + public readonly int Length => 256; public ref T this[int index] => ref AsSpan()[index]; - public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, 73); + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } } +#pragma warning restore CS0169, IDE0051 |