Skip to content

Commit be11d53

Browse files
authored
Removed incorrect MethodImpl.NoInlining attribute
Quick-fix PR to remove an unnecessary `[MethodImpl(MethodImplOptions.NoInlining)]` attribute from a throw helper method. That attribute caused the JIT not to see the throw in the body, resulting in the caller branch assuming the forward path being taken (the faulty one). This produced worse codegen, as the non-faulting path was always forced to have an extra jump ahead.
1 parent 30452cf commit be11d53

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Microsoft.Toolkit/Collections/ObservableGroupedCollectionExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ private static void RemoveItemAtWithLinq<TKey, TValue>(
444444
/// <summary>
445445
/// Throws a new <see cref="InvalidOperationException"/> when a key is not found.
446446
/// </summary>
447-
[MethodImpl(MethodImplOptions.NoInlining)]
448447
private static void ThrowArgumentExceptionForKeyNotFound()
449448
{
450449
throw new InvalidOperationException("The requested key was not present in the collection");

0 commit comments

Comments
 (0)