BTree v3.1.0 Release Notes
Release Date: 2016-10-06 // over 7 years ago-
๐ This is a feature release extending the functionality of
SortedSet
andMap
with several new methods.๐ New Features
SortedSet
Offset-based access
SortedSet.offset(of:)
returns the offset to a particular member of the set.- ๐
SortedSet.remove(atOffset:)
removes and returns the element at a particular offset in the set.
Range-based operations
SortedSet.count(elementsIn:)
returns the number of elements in the given open or closed range.SortedSet.intersection(elementsIn:)
returns the result of intersecting the set with a given open or closed range.SortedSet.formIntersection(elementsIn:)
is the in-place editing version of the above.SortedSet.subtracting(elementsIn:)
returns a set without members in the given open or closed range.SortedSet.subtract(elementsIn:)
is the in-place editing version of the previous method.
Shifting
SortedSet.shift(startingAt start: Element, by delta: Element.Stride)
is a new method for sorted sets with strideable elements. It addsdelta
to every element in the set that is greater than or equal tostart
. The elements are modified in place.
All of these new methods run in logarithmic time, except for
shift
whose complexity is linear.Map
Map.offset(of:)
is a new method for finding the offset of a particular key in the map. It has logarithmic complexity.
๐ Bug fixes
- The tvOS target now generates a framework that is explicitly restricted to only use extension-safe API.