Skip to content

Commit

Permalink
Revert "Improve nullability of OrDefault"
Browse files Browse the repository at this point in the history
This reverts commit 9d1d061.
  • Loading branch information
desplesda committed Dec 16, 2023
1 parent 76687e1 commit 350f4a9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions YarnSpinner.LanguageServer/src/Server/Utils/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace YarnLanguageServer
{
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 350f4a9

Please sign in to comment.