BTree v1.1.0 Release Notes

Release Date: 2016-02-24 // almost 6 years ago
  • ๐Ÿš€ This is a feature release that includes the following changes:

    ๐Ÿ†• New features

    • BTree, List and Map are now their own subsequences. This makes slicing them much more convenient.
    • BTree now includes a family of subtree() methods to create subtrees based on index, position or key ranges.
    • Map now includes a family of submap() methods to create subtrees based on index, position or key ranges.
    • ๐Ÿšš BTreeCursor.moveToKey(key, choosing: selector) is a new method for repositioning a cursor at a specific key.
    • ๐Ÿšš BTreeCursor.removeAll() is a new method for removing all elements.
    • ๐Ÿšš BTreeCursor.removeAllBefore(includingCurrent:) is a new method that removes all elements before the current position.
    • ๐Ÿšš BTreeCursor.removeAllAfter(includingCurrent:) is a new method that removes all elements after the current position.
    • BTree.withCursorAt(index) is a new method that allows you to create a cursor positioned at an index. (Note that it doesn't make sense to reposition a cursor that's already been created, since creating a cursor invalidates existing indices.)

    ๐Ÿ‘Œ Improvements

    • 0๏ธโƒฃ The default tree order is now based on the full element size, not just the size of the key (like in 1.0.0). The maximum node size has been bumped to 16kiB to compensate for this.
    • BTreeIndex now includes the slot number for each node on its path, making navigation a bit faster.
    • Position-based searches now start at the end of the tree if the position we're looking for is likely closer to the end than the start. This is a potential 2x improvement.
    • BTree.indexOfPosition now accepts the element count as a position, returning the tree's end index.

    Other changes

    • BTreeCursor.insertBefore has been renamed to insert.
    • BTreeCursor.isValid is not a public property anymore; invalid cursors aren't supposed to leak to correct programs.
    • There is now a shared tvOS scheme in the Xcode project. D'oh.
    • All public APIs are now documented.
    • @warn_unused_result attributes have been added for APIs that need them.