From 659eb83f4de0cb4654f5f85a6d5307a2bceb982a Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 22 Sep 2025 01:56:17 -0400 Subject: [PATCH] refactor: Drop null type modifier in TryGetFirst ext Replace w/ MaybeNullWhen attributes --- .../spark_core/Collections/Extensions/EnumerableExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs b/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs index 1c872b5dc..008eeb3cb 100644 --- a/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs +++ b/src/client/spark_core/Collections/Extensions/EnumerableExtensions.cs @@ -414,7 +414,7 @@ namespace System.Collections.Generic { } public static bool TryGetFirst( - this IEnumerable source, Func predicate, [MaybeNullWhen(false)]out T result) { + this IEnumerable source, Func predicate, [MaybeNullWhen(false)] out T result) { if (source == null) throw new ArgumentNullException(nameof(source)); foreach (T element in source) if (predicate(element)) { @@ -445,7 +445,7 @@ namespace System.Collections.Generic { } public static bool TryGetFirst( - this IEnumerable source, Func predicate, out T? result, out int index) { + this IEnumerable source, Func predicate, [MaybeNullWhen(false)]out T result, out int index) { if (source == null) throw new ArgumentNullException(nameof(source)); index = 0; foreach (T element in source) {