From 77388c64205f475061efc6899780305602807495 Mon Sep 17 00:00:00 2001 From: Xavier Hainaux Date: Sun, 2 May 2021 14:32:53 +0200 Subject: [PATCH 1/2] Use a stable sort algorithm for Iterable.sortedBy --- lib/src/iterable_extensions.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/iterable_extensions.dart b/lib/src/iterable_extensions.dart index cddc497..b0bf0ad 100644 --- a/lib/src/iterable_extensions.dart +++ b/lib/src/iterable_extensions.dart @@ -64,7 +64,7 @@ extension IterableExtension on Iterable { /// property [keyOf] of the element. List sortedBy>(K Function(T element) keyOf) { var elements = [...this]; - quickSortBy(elements, keyOf, compareComparable); + mergeSortBy(elements, keyOf, compareComparable); return elements; } @@ -75,7 +75,7 @@ extension IterableExtension on Iterable { List sortedByCompare( K Function(T element) keyOf, Comparator compare) { var elements = [...this]; - quickSortBy(elements, keyOf, compare); + mergeSortBy(elements, keyOf, compare); return elements; } From 6723a8f0fb3df6df6129282267d83e16fd2eb55c Mon Sep 17 00:00:00 2001 From: Xavier Hainaux Date: Thu, 6 May 2021 09:01:43 +0200 Subject: [PATCH 2/2] Increment version number and add changelog entry --- CHANGELOG.md | 4 +++- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e39b9d2..0e5a4af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -## 1.15.1-dev +## 1.16.0 + +* Use a stable sort algorithm in the `IterableExtension.sortedBy` method. ## 1.15.0 diff --git a/pubspec.yaml b/pubspec.yaml index 9ce3549..c8a468e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: collection -version: 1.15.1-dev +version: 1.16.0 description: Collections and utilities functions and classes related to collections. repository: https://github.com/dart-lang/collection