From 350f4a92ef33580616a703f9e62a3ce903f7ff3a Mon Sep 17 00:00:00 2001 From: Jon Manning Date: Sat, 16 Dec 2023 11:07:09 +1100 Subject: [PATCH] Revert "Improve nullability of OrDefault" This reverts commit 9d1d061909c489bcb2c40112e4a9e5095fdb9395. --- YarnSpinner.LanguageServer/src/Server/Utils/Utils.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/YarnSpinner.LanguageServer/src/Server/Utils/Utils.cs b/YarnSpinner.LanguageServer/src/Server/Utils/Utils.cs index 391f7d2aa..a0945d5ea 100644 --- a/YarnSpinner.LanguageServer/src/Server/Utils/Utils.cs +++ b/YarnSpinner.LanguageServer/src/Server/Utils/Utils.cs @@ -1,5 +1,4 @@ -using System.Diagnostics.CodeAnalysis; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; namespace YarnLanguageServer { @@ -31,16 +30,12 @@ internal static class Utils Title = "editor.action.triggerParameterHints", }; - [return: NotNullIfNotNull(nameof(@default))] - [return: NotNullIfNotNull(nameof(str))] - public static string? OrDefault(this string? str, string? @default = default) + public static string OrDefault(this string str, string @default = default) { return string.IsNullOrEmpty(str) ? @default : str; } - [return: NotNullIfNotNull(nameof(@default))] - [return: NotNullIfNotNull(nameof(str))] - public static object? OrDefault(this string? str, object? @default) + public static object OrDefault(this string str, object @default) { return string.IsNullOrEmpty(str) ? @default : str; }