From dbea7cac674b9dca0a4e9bd26cac9e3838007b65 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Sat, 5 Mar 2022 14:47:16 -0700 Subject: [PATCH] Use Enum.GetValues() --- .../Json/Converters/JsonFlagEnumConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Jellyfin.Extensions/Json/Converters/JsonFlagEnumConverter.cs b/src/Jellyfin.Extensions/Json/Converters/JsonFlagEnumConverter.cs index 6e4c85c47..4fa91fa5e 100644 --- a/src/Jellyfin.Extensions/Json/Converters/JsonFlagEnumConverter.cs +++ b/src/Jellyfin.Extensions/Json/Converters/JsonFlagEnumConverter.cs @@ -9,9 +9,9 @@ namespace Jellyfin.Extensions.Json.Converters; /// /// The type of enum. public class JsonFlagEnumConverter : JsonConverter - where T : Enum + where T : struct, Enum { - private static readonly T[] _enumValues = (T[])Enum.GetValues(typeof(T)); + private static readonly T[] _enumValues = Enum.GetValues(); /// public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)