diff --git a/.editorconfig b/.editorconfig index 258b98da29..8388ebc632 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1049,6 +1049,9 @@ dotnet_diagnostic.CA2263.severity = none # TODO: Change to warning once mono is # Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'. dotnet_diagnostic.CA2264.severity = warning +# Do not compare 'Span' to 'null' or 'default'. +dotnet_diagnostic.CA2265.severity = warning + ### Roslynator.Analyzers ### https://josefpihrt.github.io/docs/roslynator/analyzers diff --git a/OpenRA.Game/MiniYaml.cs b/OpenRA.Game/MiniYaml.cs index 2a75a65104..a737c5762a 100644 --- a/OpenRA.Game/MiniYaml.cs +++ b/OpenRA.Game/MiniYaml.cs @@ -333,7 +333,7 @@ namespace OpenRA // Note: We need to support empty comments here to ensure that empty comments // (i.e. a lone # at the end of a line) can be correctly re-serialized - var commentString = comment == default ? null : comment.ToString(); + var commentString = comment == ReadOnlySpan.Empty ? null : comment.ToString(); keyString = keyString == null ? null : stringPool.GetOrAdd(keyString); valueString = valueString == null ? null : stringPool.GetOrAdd(valueString);