v1.1.0
This is a feature release that includes the following changes:
New features
BTree
,List
andMap
are now their own subsequences. This makes slicing them much more convenient.BTree
now includes a family ofsubtree()
methods to create subtrees based on index, position or key ranges.Map
now includes a family ofsubmap()
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
- 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 toinsert
.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.