Version 5.0.0
Release notes
Synchronize changes from .net 5.
Features
- Add
size()
andisEmpty()
methods forICollection
interface. - Add
StringSplitOptions.TrimEntries
forsplit()
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
resize
times. Effected methodstoMap
,toLinkedMap
,toSet
,toLinkedSet
. - Keep first value for duplicated key. Effected methods
toMap
,toLinkedMap
. - Return empty sequence instead of throw
ArgumentNullException
when source is null. Effected methodsof
,as
,chars
,words
,lines
,split
.
Tips
- In order to reduce sorting time, methods
first(predicate)
andfirstOrDefault(predicate)
afterOrderedEnumerable
call 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
skipLast
andtakeLast
when the source will be modified.
See dotnet/runtime#42506.