Add ImmutableArray<T>.Builder.DrainToImmutable() (#79385)
authorJeff Handley <jeffhandley@users.noreply.github.com>
Thu, 8 Dec 2022 21:50:09 +0000 (13:50 -0800)
committerGitHub <noreply@github.com>
Thu, 8 Dec 2022 21:50:09 +0000 (13:50 -0800)
commit41ae1aebcce81dbe742bad16533b70d0f46ef7c8
tree929838c195a421792c34fa68652d9f7d417db550
parenta30de6d40f69ef612b514344a5ec83fffd10b957
Add ImmutableArray<T>.Builder.DrainToImmutable() (#79385)

* Add ImmutableArray<T>.Builder.DrainToImmutable

* Refactor DrainToImmutable for a more optimized implementation

* Augment and refine DrainToImmutable unit tests
src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Builder.cs
src/libraries/System.Collections.Immutable/tests/ImmutableArrayBuilderTest.cs