mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
perf: Optimizing object instantiation for default constructors
This commit is contained in:
@@ -220,6 +220,9 @@ namespace ICD.Common.Utils
|
|||||||
if (parameters == null)
|
if (parameters == null)
|
||||||
throw new ArgumentNullException("parameters");
|
throw new ArgumentNullException("parameters");
|
||||||
|
|
||||||
|
if (parameters.Length == 0)
|
||||||
|
return Activator.CreateInstance(type);
|
||||||
|
|
||||||
ConstructorInfo constructor = GetConstructor(type, parameters);
|
ConstructorInfo constructor = GetConstructor(type, parameters);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user