BTree v3.1.0 Release Notes

Release Date: 2016-10-06 // over 5 years ago
  • ๐Ÿš€ This is a feature release extending the functionality of SortedSet and Map with several new methods.

    ๐Ÿ†• New Features


    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.


    • SortedSet.shift(startingAt start: Element, by delta: Element.Stride) is a new method for sorted sets with strideable elements. It adds delta to every element in the set that is greater than or equal to start. The elements are modified in place.

    All of these new methods run in logarithmic time, except for shift whose complexity is linear.

    • 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.