perf: Optimizing object instantiation for default constructors

This commit is contained in:
Chris Cameron
2019-04-01 14:16:56 -04:00
parent 100b8e4753
commit bcf13ef972

View File

@@ -220,6 +220,9 @@ namespace ICD.Common.Utils
if (parameters == null)
throw new ArgumentNullException("parameters");
if (parameters.Length == 0)
return Activator.CreateInstance(type);
ConstructorInfo constructor = GetConstructor(type, parameters);
try