Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix System.Collections.Immutable!ImmutableArray<T>.Builder.Sort() to …
…not generate Comparer wrapper each time System.Collections.Immutable!ImmutableArray<T>.Builder.Sort() (3 overloads) creates a new Comparer wrapper each time. This can get expensive if you call Sort a lot. This fix optmizes method Sort() alone among the 3 overloads. Sort() uses the default comparer which through this fix is getting cached into a static field in type Comparer such that the Comparer wrapper is not created each time Sort() is called. Existing testcase Sort(), covers this case.
- Loading branch information