Skip to content

Commit

Permalink
Unnecessary double allocation in DictionaryTKeyEnumTValueConverter.cs (
Browse files Browse the repository at this point in the history
  • Loading branch information
rextor92 committed Mar 23, 2024
1 parent 55d4438 commit 17b2f90
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public override JsonConverter CreateConverter(
Type type,
JsonSerializerOptions options)
{
Type keyType = type.GetGenericArguments()[0];
Type valueType = type.GetGenericArguments()[1];
Type[] typeArguments = type.GetGenericArguments();
Type keyType = typeArguments[0];
Type valueType = typeArguments[1];

JsonConverter converter = (JsonConverter)Activator.CreateInstance(
typeof(DictionaryEnumConverterInner<,>).MakeGenericType(
Expand Down

0 comments on commit 17b2f90

Please sign in to comment.