This is a feature release adding several useful operations to ordered collections, as well as shipping bug fixes that landed since 1.5.1.
The list of supported Swift toolchain versions remains 6.0, 6.1, 6.2, and 6.3 for now. Note that we intend to retire support for Swift 6.0 and 6.1 in a subsequent release later this year.
New OrderedCollections operations
We now have several new operations that move existing elements in an OrderedSet or OrderedDictionary to a new position within the same collection:
OrderedSet.moveSubrange(_:to:)andOrderedDictionary.moveSubrange(_:to:)move items at a range of indices to just before the item at the specified destination index.OrderedSet.move(members:to:)andOrderedDictionary.move(keys:to:)relocate elements identified by value (or key), preserving the order in which they're listed.OrderedSet.move(indices:to:)andOrderedDictionary.move(indices:to:)relocate items at an arbitrary sequence of indices, preserving their listed order.
Bugfixes
SortedCollections[with theUnstableSortedCollectionstrait]: The default capacity of B-tree nodes is no longer clamped at 16, improving performance. (#257)DequeModule: The ownership-awareRigidDequeandUniqueDequetypes no longer hand out invalid spans to clients (#659)ContainersPreview[with theUnstableContainersPreviewtrait]: The deprecatedBorrowtype alias is now declared with correct availability. (#655)
What's Changed
- Add missing availability to Borrow by @guoye-zhang in #655
- [InternalCollectionsUtilities] Fix _trim returning the wrong buffer region by @adityasingh2400 in #659
- [SortedCollections] Fix _BTree default node capacity capping at 16 by @adityasingh2400 in #661
- Small benchmarking improvements by @lorentey in #664
- [OrderedCollections] Add move operations by @dnadoba in #660
- 1.6.0 prerelease cleanups by @lorentey in #665
New Contributors
- @guoye-zhang made their first contribution in #655
- @adityasingh2400 made their first contribution in #659
Full Changelog: 1.5.1...1.6.0