Skip to content

Commit

Permalink
Add AggressiveInlining
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Jun 16, 2024
1 parent fad273d commit bcc2f3a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,7 @@ ref MemoryMarshal.GetReference(value),
/// </summary>
/// <param name="span">The span to search.</param>
/// <param name="value">The value to compare.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool StartsWith<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>? =>
span.Length != 0 && (span[0]?.Equals(value) ?? (object?)value is null);

Expand All @@ -2632,6 +2633,7 @@ public static bool StartsWith<T>(this ReadOnlySpan<T> span, T value) where T : I
/// </summary>
/// <param name="span">The span to search.</param>
/// <param name="value">The value to compare.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool EndsWith<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>? =>
span.Length != 0 && (span[^1]?.Equals(value) ?? (object?)value is null);

Expand Down

0 comments on commit bcc2f3a

Please sign in to comment.