Check empty string more explicitly in `IsRomanised()`

Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
This commit is contained in:
Bartłomiej Dach 2021-06-11 06:38:53 +02:00
parent 7fd26ff3b0
commit 375f64ffd1
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ public static class MetadataUtils
/// Returns <see langword="true"/> if the string <paramref name="str"/> can be used in <see cref="BeatmapMetadata.Artist"/> and <see cref="BeatmapMetadata.Title"/> fields. /// Returns <see langword="true"/> if the string <paramref name="str"/> can be used in <see cref="BeatmapMetadata.Artist"/> and <see cref="BeatmapMetadata.Title"/> fields.
/// Strings not matched by this method can be placed in <see cref="BeatmapMetadata.ArtistUnicode"/> and <see cref="BeatmapMetadata.TitleUnicode"/>. /// Strings not matched by this method can be placed in <see cref="BeatmapMetadata.ArtistUnicode"/> and <see cref="BeatmapMetadata.TitleUnicode"/>.
/// </summary> /// </summary>
public static bool IsRomanised(string? str) => str == null || str.All(IsRomanised); public static bool IsRomanised(string? str) => string.IsNullOrEmpty(str) || str.All(IsRomanised);
/// <summary> /// <summary>
/// Returns a copy of <paramref name="str"/> with all characters that do not match <see cref="IsRomanised(char)"/> removed. /// Returns a copy of <paramref name="str"/> with all characters that do not match <see cref="IsRomanised(char)"/> removed.