Skip to content

Commit

Permalink
Maybe ParameterTypes a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Nov 21, 2024
1 parent 7f77697 commit 5c87de8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions MaxMind.Db/TypeAcivatorCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ internal readonly struct TypeActivator
internal readonly Dictionary<Key, ParameterInfo> DeserializationParameters;
internal readonly Dictionary<string, ParameterInfo> InjectableParameters;
internal readonly List<ParameterInfo> NetworkParameters;
private readonly Type[] ParameterTypes;

internal TypeActivator(
ObjectActivator activator,
Expand All @@ -35,9 +34,8 @@ List<ParameterInfo> alwaysCreatedParameters
InjectableParameters = injectables;

NetworkParameters = networkParameters;
ParameterTypes =
deserializationParameters.Values.OrderBy(x => x.Position).Select(x => x.ParameterType).ToArray();
_defaultParameters = ParameterTypes.Select(DefaultValue).ToArray();
Type[] parameterTypes = deserializationParameters.Values.OrderBy(x => x.Position).Select(x => x.ParameterType).ToArray();
_defaultParameters = parameterTypes.Select(DefaultValue).ToArray();
}

internal object[] DefaultParameters() => (object[])_defaultParameters.Clone();
Expand Down

0 comments on commit 5c87de8

Please sign in to comment.