diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-08-22 13:12:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 13:12:58 +0200 |
commit | 7ebb25cca193063f0a3ff2ec8b6206e0832e1215 (patch) | |
tree | fbcfa265403eeaac463038c2b08cd2475f267b30 /src/nvim/marktree.c | |
parent | 3d3c0c669d054ef49304223e3b91ac820996d1e0 (diff) | |
parent | c265fd31ab2b0307650ad94e1ea272e9360c345f (diff) | |
download | rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.tar.gz rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.tar.bz2 rneovim-7ebb25cca193063f0a3ff2ec8b6206e0832e1215.zip |
Merge pull request #15451 from bfredl/metamap
perf(map): get rid of unnecessary pointer indirections for maps.
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; |