Skip to content

Commit bcc2f3a

Browse files
committed
Add AggressiveInlining
1 parent fad273d commit bcc2f3a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,6 +2624,7 @@ ref MemoryMarshal.GetReference(value),
26242624
/// </summary>
26252625
/// <param name="span">The span to search.</param>
26262626
/// <param name="value">The value to compare.</param>
2627+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
26272628
public static bool StartsWith<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>? =>
26282629
span.Length != 0 && (span[0]?.Equals(value) ?? (object?)value is null);
26292630

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

0 commit comments

Comments
 (0)