diff options
| author | Björn Linse <bjorn.linse@gmail.com> | 2021-08-22 10:41:18 +0200 |
|---|---|---|
| committer | Björn Linse <bjorn.linse@gmail.com> | 2021-08-22 10:46:04 +0200 |
| commit | b888018aed249174aad7586859ac5142f1a3ef10 (patch) | |
| tree | b9d09498bce6dd8852363f3acae71324be03ca4b /src/nvim/marktree.c | |
| parent | b2277a42790907424ed2cd37d3d991650bb88441 (diff) | |
| download | rneovim-b888018aed249174aad7586859ac5142f1a3ef10.tar.gz rneovim-b888018aed249174aad7586859ac5142f1a3ef10.tar.bz2 rneovim-b888018aed249174aad7586859ac5142f1a3ef10.zip | |
refactor(marktree): embed the keymap in the MarkTree struct
Diffstat (limited to 'src/nvim/marktree.c')
| -rw-r--r-- | src/nvim/marktree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c index d0d843cbf8..a04f250fc3 100644 --- a/src/nvim/marktree.c +++ b/src/nvim/marktree.c @@ -250,7 +250,6 @@ void marktree_put_key(MarkTree *b, int row, int col, uint64_t id) if (!b->root) { b->root = (mtnode_t *)xcalloc(1, ILEN); - b->id2node = pmap_new(uint64_t)(); b->n_nodes++; } mtnode_t *r, *s; @@ -547,9 +546,9 @@ void marktree_clear(MarkTree *b) marktree_free_node(b->root); b->root = NULL; } - if (b->id2node) { - pmap_free(uint64_t)(b->id2node); - b->id2node = NULL; + if (b->id2node->table.keys) { + pmap_destroy(uint64_t)(b->id2node); + pmap_init(uint64_t, b->id2node); } b->n_keys = 0; b->n_nodes = 0; |