From 9118ff4b33d7e06e93f66f41d5c3feaf85712259 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Mon, 18 Sep 2017 07:39:12 +0100 Subject: [PATCH] Not Found property --- .../src/System/Collections/Generic/Dictionary.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs index 5ad90f93e754..0686aee19d8d 100644 --- a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs +++ b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs @@ -392,7 +392,7 @@ private ref Entry FindEntryDefaultComparer(TKey key, out bool found) } found = false; - return ref s_nullEntry; + return ref NotFound; } private ref Entry FindEntryCustomComparer(TKey key, IEqualityComparer comparer, out bool found) @@ -416,7 +416,13 @@ private ref Entry FindEntryCustomComparer(TKey key, IEqualityComparer comp } found = false; - return ref s_nullEntry; + return ref NotFound; + } + + private static ref Entry NotFound + { + [MethodImpl(MethodImplOptions.NoInlining)] + get => ref s_nullEntry; } private int[] Initialize(int capacity)