refactor: Drop nullable modifier for TValue in GetValueOrDefault ext fn

This commit is contained in:
John Colvin committed 2025-11-15 12:38:50 -05:00
1 parent 75f2678df6
commit b9e191eeb9
1 file changed
+3 -1
@@ -1,6 +1,7 @@
using bts.collections;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace System.Collections.Generic {
@@ -114,7 +115,8 @@ namespace System.Collections.Generic {
}
#nullable enable
public static TValue? GetValueOrDefault<TKey, TValue>(this Dictionary<TKey, TValue?>? dictionary, TKey key) where TKey : notnull {
[return:MaybeNull]
public static TValue GetValueOrDefault<TKey, TValue>(this Dictionary<TKey, TValue>? dictionary, TKey key) where TKey : notnull {
if (dictionary is null) {
throw new ArgumentNullException(nameof(dictionary));
}