Dictionary and Enumerable Mappings: Call EnsureCapacity
if source count is known and target has a EnsureCapacity(int)
method
#251
Labels
If Mapperly generates a
foreach
/Add
mapping the capacity of the target is increased as needed.If the source/target count is known (type does have a
Count
/Length
property orEnumerable.TryGetNonEnumeratedCount()
returns true) and the target type does have a MethodEnsureCapacity(int)
,EnsureCapacity(source.Count + target.Count)
can be called to ensure the target collection has a big enough capacity for all source objects plus the existing target objects and does not need to resize as mapped objects are added.The text was updated successfully, but these errors were encountered: