Tags: tidwall/btree
Tags
Added AscendHint, DescendHint, and SeekHint to BTree and BTreeG These new functions allow for using a path hint with iterators, making it potentially faster when seeking to the first item in the iteration. Benchmarks: https://github.com/tidwall/btree-benchmark About path hints: https://github.com/tidwall/btree/blob/master/PATH_HINT.md Usage: ```go tr.AscendHint(key, iter, &hint) // iterate items that are >= key, ascending tr.DescendHint(key, iter, &hint) // iterate items that are <= key, descending iter.SeekHint(key, &hint) // seek to item that is >= key ```
Added Mut methods This commits includes new Mut methods which ensure that values get correctly copied, if needed, following a btree Copy() operations. This effictively allows for the BTree Copy method to create an isolated snapshot that cascades to the interior values. Such as a BTree that has nested BTrees as values. Mut methods are only useful when all of the following are true: - The interior data of the values require changes. - The value is a pointer type. - The BTree has been copied using `Copy()` or `IsoCopy()`. - The value itself has a `Copy()` or `IsoCopy()` method. Mut methods may modify the tree structure and should have the same considerations as other mutable operations like Set, Delete, Clear, etc. New methods include GetMut, ScanMut, AscendMut, DescendMut, ReverseMut, IterMut, MinMut, MaxMut, etc.
PreviousNext