Added FisheryLib.Collections.FishTable and Mono.Cecil extension methods

A bit of refactoring has been done too
This commit is contained in:
bbradson
2023-06-03 20:10:58 +02:00
parent 8fa92f15a6
commit cdf209eb02
72 changed files with 8145 additions and 2098 deletions
+4 -3
View File
@@ -6,6 +6,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using JetBrains.Annotations;
namespace FisheryLib;
@@ -14,6 +15,7 @@ namespace FisheryLib;
/// </summary>
/// <typeparam name="T">The type of items to enumerate.</typeparam>
[EditorBrowsable(EditorBrowsableState.Never)]
[PublicAPI]
public ref struct ReadOnlySpanEnumerable<T>
{
/// <summary>
@@ -58,7 +60,7 @@ public ref struct ReadOnlySpanEnumerable<T>
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
// See comment in SpanEnumerable<T> about this
// See comment in SpanEnumerable<T> about this
=> new(ref Unsafe.Add(ref _span.DangerousGetPinnableReference(), (nint)(uint)_index), _index);
}
@@ -79,8 +81,7 @@ public ref struct ReadOnlySpanEnumerable<T>
/// <param name="value">A reference to the target value.</param>
/// <param name="index">The index of the target value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Item(ref T value, int index)
=> _span = MemoryMarshal.CreateReadOnlySpan(ref value, index);
public Item(ref T value, int index) => _span = MemoryMarshal.CreateReadOnlySpan(ref value, index);
/// <summary>
/// Gets the reference to the current value.