diff options
| author | cvium <clausvium@gmail.com> | 2021-03-07 22:59:08 +0100 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-03-07 22:59:08 +0100 |
| commit | fcacae8cdeb3be15b27952d873ae08e29b6c7f94 (patch) | |
| tree | aa184438fd8efd46d13693342f16f2db5afcca6e /Emby.Naming/Video/CleanStringParser.cs | |
| parent | e0db17a9354ff511c31c7bcf02c41d868ed91c5a (diff) | |
return empty span instead of null for backwards compat
Diffstat (limited to 'Emby.Naming/Video/CleanStringParser.cs')
| -rw-r--r-- | Emby.Naming/Video/CleanStringParser.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Emby.Naming/Video/CleanStringParser.cs b/Emby.Naming/Video/CleanStringParser.cs index deeea4dda..bd7553a91 100644 --- a/Emby.Naming/Video/CleanStringParser.cs +++ b/Emby.Naming/Video/CleanStringParser.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; namespace Emby.Naming.Video @@ -17,7 +16,7 @@ namespace Emby.Naming.Video /// <param name="expressions">List of regex to parse name and year from.</param> /// <param name="newName">Parsing result string.</param> /// <returns>True if parsing was successful.</returns> - public static bool TryClean(string name, IReadOnlyList<Regex> expressions, [NotNullWhen(true)] out ReadOnlySpan<char> newName) + public static bool TryClean(string name, IReadOnlyList<Regex> expressions, out ReadOnlySpan<char> newName) { var len = expressions.Count; for (int i = 0; i < len; i++) @@ -32,11 +31,11 @@ namespace Emby.Naming.Video return false; } - private static bool TryClean(string name, Regex expression, [NotNullWhen(true)] out ReadOnlySpan<char> newName) + private static bool TryClean(string name, Regex expression, out ReadOnlySpan<char> newName) { if (string.IsNullOrEmpty(name)) { - newName = null; + newName = ReadOnlySpan<char>.Empty; return false; } @@ -48,7 +47,7 @@ namespace Emby.Naming.Video return true; } - newName = string.Empty; + newName = ReadOnlySpan<char>.Empty; return false; } } |
