1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

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

View File

@ -23,7 +23,7 @@ namespace osu.Game.Beatmaps
/// 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"/>.
/// </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>
/// Returns a copy of <paramref name="str"/> with all characters that do not match <see cref="IsRomanised(char)"/> removed.