.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
This PR adds an API to enumerate items in an array builder without allocating a whole array.
It also uses this API when creating a BlockSyntax, to avoid wasting an array just to enumerate items.
The returned enumerable is readonly, ensuring mutations must go through the actual builder.
PR Checklist
[X] Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
[X] Based off latest main branch of toolkit
[X] PR doesn't include merge commits (always rebase on top of our main, if needed)
Overview
This PR adds an API to enumerate items in an array builder without allocating a whole array. It also uses this API when creating a
BlockSyntax
, to avoid wasting an array just to enumerate items. The returned enumerable is readonly, ensuring mutations must go through the actual builder.PR Checklist