Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Move Cast<T> call when in .NET Standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Jan 31, 2024
1 parent ca4cc7c commit 76f5ade
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/JsonSerializationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ public void WriteEnumValue<T>(string? key, T? value) where T : struct, Enum
Enum.GetValues<T>()
#else
Enum.GetValues(typeof(T))
.Cast<T>()
#endif
.Cast<T>()
.Where(x => value.Value.HasFlag(x))
.Select(GetEnumName)
.Aggregate((x, y) => $"{x},{y}"));
.Where(x => value.Value.HasFlag(x))
.Select(GetEnumName)
.Aggregate((x, y) => $"{x},{y}"));
else writer.WriteStringValue(GetEnumName(value.Value));
}
}
Expand Down

0 comments on commit 76f5ade

Please sign in to comment.