mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Use Enum.GetValues<T>()
This commit is contained in:
parent
bbd5d11d3b
commit
dbea7cac67
@ -9,9 +9,9 @@ namespace Jellyfin.Extensions.Json.Converters;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">The type of enum.</typeparam>
|
/// <typeparam name="T">The type of enum.</typeparam>
|
||||||
public class JsonFlagEnumConverter<T> : JsonConverter<T>
|
public class JsonFlagEnumConverter<T> : JsonConverter<T>
|
||||||
where T : Enum
|
where T : struct, Enum
|
||||||
{
|
{
|
||||||
private static readonly T[] _enumValues = (T[])Enum.GetValues(typeof(T));
|
private static readonly T[] _enumValues = Enum.GetValues<T>();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user