Skip to content

Commit ae961dd

Browse files
committed
Minor codegen improvements
1 parent f31c2c7 commit ae961dd

File tree

4 files changed

+1
-4
lines changed

4 files changed

+1
-4
lines changed

Microsoft.Toolkit.HighPerformance/Extensions/IBufferWriterExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ public static void Write<T>(this IBufferWriter<T> writer, ReadOnlySpan<T> span)
102102
/// <summary>
103103
/// Throws an <see cref="ArgumentException"/> when trying to write too many bytes to the target writer.
104104
/// </summary>
105-
[MethodImpl(MethodImplOptions.NoInlining)]
106105
private static void ThrowArgumentExceptionForEndOfBuffer()
107106
{
108107
throw new ArgumentException("The current buffer writer can't contain the requested input data.");

Microsoft.Toolkit.HighPerformance/Extensions/ReadOnlySpanExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static unsafe int IndexOf<T>(this ReadOnlySpan<T> span, in T value)
164164
/// <param name="value">The <typeparamref name="T"/> value to look for.</param>
165165
/// <returns>The number of occurrences of <paramref name="value"/> in <paramref name="span"/>.</returns>
166166
[Pure]
167-
[MethodImpl(MethodImplOptions.NoInlining)]
167+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
168168
public static int Count<T>(this ReadOnlySpan<T> span, T value)
169169
where T : IEquatable<T>
170170
{

Microsoft.Toolkit.HighPerformance/Extensions/SpanExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ public static int GetDjb2HashCode<T>(this Span<T> span)
223223
/// <summary>
224224
/// Throws an <see cref="ArgumentOutOfRangeException"/> when the given reference is out of range.
225225
/// </summary>
226-
[MethodImpl(MethodImplOptions.NoInlining)]
227226
internal static void ThrowArgumentOutOfRangeExceptionForInvalidReference()
228227
{
229228
throw new ArgumentOutOfRangeException("value", "The input reference does not belong to an element of the input span");

Microsoft.Toolkit.HighPerformance/Extensions/StreamExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ public static void Write<T>(this Stream stream, in T value)
245245
/// <summary>
246246
/// Throws an <see cref="InvalidOperationException"/> when <see cref="Read{T}"/> fails.
247247
/// </summary>
248-
[MethodImpl(MethodImplOptions.NoInlining)]
249248
private static void ThrowInvalidOperationExceptionForEndOfStream()
250249
{
251250
throw new InvalidOperationException("The stream didn't contain enough data to read the requested item");

0 commit comments

Comments
 (0)