Add System.Linq Chunk extension method (#47965)
authorRobert Andersson <robert.andersson.swe@gmail.com>
Wed, 10 Feb 2021 19:41:59 +0000 (20:41 +0100)
committerGitHub <noreply@github.com>
Wed, 10 Feb 2021 19:41:59 +0000 (19:41 +0000)
commit515bfafb35f31ea689917c20b8e6a54c7e4a25d4
tree67480a69369fce1a5f93372bb21a889b9e5382a6
parent2b95ec6c4726a7571652fa5d261221377e91fdda
Add System.Linq Chunk extension method (#47965)

* Add System.Linq Chunk extension method

Fix #27449

* Use explicit types instead of type inference

* Seperate inner and outer loop

* Rename parameter maxSize to size

* Add missing license header

* Remove Chunk.SpeedOpt.cs

* Add tests to verify Chunk works after mutations

* Add/remove before getting enumerator in tests

* Test content of chunk method for IQueryable<T>
12 files changed:
src/libraries/System.Linq.Queryable/ref/System.Linq.Queryable.cs
src/libraries/System.Linq.Queryable/src/ILLink/ILLink.Suppressions.xml
src/libraries/System.Linq.Queryable/src/System/Linq/CachedReflection.cs
src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs
src/libraries/System.Linq.Queryable/tests/ChunkTests.cs [new file with mode: 0644]
src/libraries/System.Linq.Queryable/tests/System.Linq.Queryable.Tests.csproj
src/libraries/System.Linq/ref/System.Linq.cs
src/libraries/System.Linq/src/System.Linq.csproj
src/libraries/System.Linq/src/System/Linq/Chunk.cs [new file with mode: 0644]
src/libraries/System.Linq/src/System/Linq/ThrowHelper.cs
src/libraries/System.Linq/tests/ChunkTests.cs [new file with mode: 0644]
src/libraries/System.Linq/tests/System.Linq.Tests.csproj