Version 5.0.0
Release notes
Synchronize changes from .net 5.
Features
- Add
size()andisEmpty()methods forICollectioninterface. - Add
StringSplitOptions.TrimEntriesforsplit()method. - Add
zip()api to cast three sequence into a Tuple3 sequence.
Changes
- Improve performance of method
ArrayListEnumerable.toArray(Class<TSource> clazz). - Optimize allocation of hash sets to reduce the number of
resizetimes. Effected methodstoMap,toLinkedMap,toSet,toLinkedSet. - Keep first value for duplicated key. Effected methods
toMap,toLinkedMap. - Return empty sequence instead of throw
ArgumentNullExceptionwhen source is null. Effected methodsof,as,chars,words,lines,split.
Tips
- In order to reduce sorting time, methods
first(predicate)andfirstOrDefault(predicate)afterOrderedEnumerablecall the predicate once per element.
So don't call side-effect methods in linq.
See dotnet/runtime#31554. - Don't reuse the lazy result of
skipLastandtakeLastwhen the source will be modified.
See dotnet/runtime#42506.