1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Reuse value to save enum name

Co-authored-by: Salman Ahmed <frenzibyte@gmail.com>
This commit is contained in:
Henry Lin 2021-08-30 18:05:47 +08:00 committed by GitHub
parent 04bf667d0d
commit 8137eee527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,8 +123,8 @@ namespace osu.Game.Screens.Select
{
if (Enum.TryParse(value, true, out result)) return true;
string status = Enum.GetNames(typeof(TEnum)).FirstOrDefault(name => name.StartsWith(value, true, CultureInfo.InvariantCulture));
return Enum.TryParse(status, true, out result);
value = Enum.GetNames(typeof(TEnum)).FirstOrDefault(name => name.StartsWith(value, true, CultureInfo.InvariantCulture));
return Enum.TryParse(value, true, out result);
}
/// <summary>