This is to potentially address some gremlins I've noticed with Ditto in which it sometimes runs slow and sometimes seems to run the same code multiple times.
I haven't tested this yet. For now, I'm curious if you think this will have any impact. If I get a free moment, I'll test this on some websites I've been working with to see if if affects anything.
I added ToArray to the .As extension method that operations on IEnumerables. This is called from RecursiveDittoAttribute, which I think is called on every property by default. This may affect a large portion of properties that are collections.
I added ToArray to DittoFactoryAttribute, which is used in scenarios where you may be creating lists of items (I'm pretty sure I use this indirectly anytime I map a collection of widgets, which is the primary use case I have for Ditto).
This is to potentially address some gremlins I've noticed with Ditto in which it sometimes runs slow and sometimes seems to run the same code multiple times.
I haven't tested this yet. For now, I'm curious if you think this will have any impact. If I get a free moment, I'll test this on some websites I've been working with to see if if affects anything.
This relates to this discussion: https://our.umbraco.com/packages/developer-tools/ditto/ditto-feedback/94330-deferred-execution-causing-repeat-execution
I also noticed some typos that I fixed in this PR.