Skip to content

Releases: timandy/linq

Version 6.0.0

18 Dec 08:16
Compare
Choose a tag to compare

Release notes

Synchronize changes from .net 6.

Features

  • Add type Index indicates a forward or reverse index.
  • Add type Range indicates a range between start and end Index.
  • Add new method chunk() to support slicing by a fixed number of elements.
  • Add new overloads for elementAt(Index) and elementAtOrDefault(Index) methods to support get element by forward or reverse index.
  • Add new overloads for firstOrDefault(), lastOrDefault() and singleOrDefault() methods to support return custom default value when sequence is empty.
  • Add new overloads for max(), maxBy(), min() and minBy() methods to support custom comparer.
  • Add new overloads for take(Range) method to support get elements between start and end Index.
  • Add new overloads for toMap() and toLinkedMap() methods to specify which key to keep when conflicting.

Changes

  • Modify first param type of methods exceptBy(...) and intersectBy(...) from IEnumerable<? extends TSource> to IEnumerable<? extends TKey>.

Tips

  • Now skipLast() and takeLast() methods support mutable sequence.

Links

Version 5.0.0

01 Feb 11:13
Compare
Choose a tag to compare

Release notes

Synchronize changes from .net 5.

Features

  • Add size() and isEmpty() methods for ICollection interface.
  • Add StringSplitOptions.TrimEntries for split() 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 methods toMap,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 methods of, as, chars, words, lines, split.

Tips

  • In order to reduce sorting time, methods first(predicate) and firstOrDefault(predicate) after OrderedEnumerable 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 and takeLast when the source will be modified.
    See dotnet/runtime#42506.

Links

Version 3.1.0

10 Dec 06:15
Compare
Choose a tag to compare

Release notes

Features

  • Support custom debug view for any type by DebuggerDisplay, DebuggerTypeProxy annotation.

Changes

  • Rename DebugView.getDebuggerDisplay(...) to DebugView.getDebuggerDisplayText(...).
  • Rename DebugView.getDebuggerTypeProxy(...) to DebugView.getDebuggerProxyObject(...).
  • Modify debugger display for types which is cheap to count the elements.

Links

Version 3.0.0

20 Sep 02:05
Compare
Choose a tag to compare

Release notes

This is the first stable version available for production. It is highly recommended to upgrade to this version if you have used a previous version.

Bugs

  • Fix unsigned compare bugs.
  • Fix Lookup.ApplyResultSelector bugs.
  • Fix OrderedEnumerableRangeEnumerator not iterate maxIdx.
  • Fix EnumerablePartition error assert.
  • Fix inner enumerator of CrossJoinIterator and SelectManyIterator dispose twice.
  • Fix not check selector param for sum with selector.
  • Fix bug with select(...).count() on an IPartition.
  • Fix bug with skip, take on an empty IOrderedEnumerable.
  • Fix union and unionBy not close when break iterate.

Features

  • Add zip Tuple api.
  • Add support compatible stream for IEnumerable.
  • Add api toLinkedList, toLinkedMap, toLinkedSet, toCollection for IEnumerable.
  • Add api indexOf, lastIndexOf for IEnumerable.
  • Add api findIndex, findLastIndex for IEnumerable.
  • Add api format, joining for IEnumerable to print values.
  • Add api ofNullable, chars, words, lines, split, infinite, loop, enumerate, iterate for Linq.
  • Add _indexOf and _lastIndexOf method for IList.
  • Add _findIndex() and _findLastIndex() method for IList.
  • Add IArrayList interface which extends RandomAccess for random access list and IList for other.
  • Add IArray interface to determine IArrayList contains an array or not.
  • Add CultureInfo.setCurrent to set current locale for string actions in linq.
  • Add StringComparer for string equals, hashCode and compare actions.
  • Add ValueType as super class for value type.
  • Add support more type cast to IEnumerable like IEnumerable, Iterator and Enumeration.
  • Add Linq.as() to generate IEnumerable from Object.
  • Add debug view support.
  • Add primitive functional interface.
  • Add covariant & contravariant support.

Optimizations

  • Remove override runOnce() for IList.
  • Not copy data when cast primitive array to IEnumerable.
  • Not create array when cast singleton to IEnumerable.
  • Optimize performance of takeLast.
  • Optimize range().select() and repeat().select().
  • Optimize min, max, minBy, maxBy performance.
  • Optimize TakeLastIterator dispose action.
  • Optimize toMap and toSet methods.
  • Optimize indexOf and lastIndexOf in EqualityComparer.
  • Optimize skipLast performance.
  • Optimize performance by use enumerator instead of iterator.
  • Implements IIListProvider for DistinctByIterator, CrossJoinIterator, UnionByIterator.

Changes

  • Translated all LINQ to Objects API of .net core 3.0.
  • Use ThrowHelper to throw Exceptions.
  • Rename package bridge to adapter.
  • Rename Linq.asEnumerable() to Linq.of().
  • Rename TupleMore to TupleN.
  • Rename Linq.of(CharSequence) to Linq.chars(CharSequence).
  • Update junit version to 5.x.
  • Update plugin version to latest.
  • Change the year of copyright.

Parameters covariant

  • IEnumerable (T is covariant)
  • IEnumerator (T is covariant)
  • IGrouping<TKey, TElement> (TKey and TElement are covariant)

Parameters contravariant

  • Comparator (T is contravariant)
  • Comparable (T is contravariant)
  • IEqualityComparer (T is contravariant)
  • IComparison (T is contravariant)
  • Action<T1, T2, ... TN> (T1...TN are contravariant)
  • Func<T1, T2, ... TResult> (T1...TN are contravariant, TResult is covariant)
  • Predicate<T1, T2, ... TN> (T1...TN are contravariant)

Links

Version 2.0.1

04 Jan 06:01
Compare
Choose a tag to compare

Release notes

Bugs

  • Fix first firstOrDefault bugs.

Features

  • Refactor from .net core 2.
  • Performance improvement.

Links

Version 2.0.0

25 May 13:22
Compare
Choose a tag to compare

Release notes

Bugs

  • Fix Comparer.compare() bugs.

Features

  • Translated all LINQ to Objects API of .net core 2.0.
  • Add class out, ref.
  • A lot of refactoring optimization has been done.

Changes

  • Performance improvement.
  • Update plugin to latest version.

Links

Version 1.0.1

16 Aug 09:28
Compare
Choose a tag to compare

Release notes

Bugs

  • Fix Buffer count is zero throws NullPointerException.

Features

  • Add API distinctBy, unionBy, intersectBy, exceptBy, minBy, maxBy.
  • Support CI.
  • Update logo.

Links

Version 1.0.0

03 Aug 14:41
Compare
Choose a tag to compare

Release notes

Features

  • Translated all LINQ to Objects API of .net framework 4.7.
  • Add unit test cases.
  • Add API leftJoin, rightJoin, fullJoin, crossJoin.
  • Support cast CharSequence to IEnumerable.
  • Add Tuple definitions.

Links