mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
perf: Optimizing object instantiation for default constructors
This commit is contained in:
parent
100b8e4753
commit
bcf13ef972
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue