Skip to content

Commit c789b7e

Browse files
committed
Update readme to mention diffing computation capabilities
1 parent 3f770b8 commit c789b7e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Features
3838
- Throws an exception if you try to use `NaN` as a key, but infinity is allowed.
3939
- No dependencies. 16K minified.
4040
- Includes a lattice of interfaces for TypeScript users (see below)
41+
- Supports diffing computation between two trees that is highly optimized for the case
42+
in which a majority of nodes are shared (such as when persistent methods are used).
4143

4244
### Additional operations supported on this B+ tree ###
4345

@@ -56,6 +58,7 @@ Features
5658
- Get largest key/pair that is lower than `k`: `t.nextLowerKey(k)`, `t.nextLowerPair(k)`
5759
- Freeze to prevent modifications: `t.freeze()` (you can also `t.unfreeze()`)
5860
- Fast clone: `t.clone()`
61+
- Compute a diff between two trees: `t.diffAgainst(otherTree, ...)`
5962
- For more information, **see [full documentation](https://github.com/qwertie/btree-typescript/blob/master/b%2Btree.ts) in the source code.**
6063

6164
**Note:** Confusingly, the ES6 `Map.forEach(c)` method calls `c(value,key)` instead of `c(key,value)`, in contrast to other methods such as `set()` and `entries()` which put the key first. I can only assume that they reversed the order on the hypothesis that users would usually want to examine values and ignore keys. BTree's `forEach()` therefore works the same way, but there is a second method `.forEachPair((key,value)=>{...})` which sends you the key first and the value second; this method is slightly faster because it is the "native" for-each method for this class.

0 commit comments

Comments
 (0)