From de21e6ef3d9af96d2b71e54d8148d28b5fc9f22e Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 22 Aug 2021 16:03:21 +0200 Subject: refactor(map): remove extra-allocating map_new/map_free functions Note: the reason for removing them is not that there after this refactor is no use of them, but rather that having them available is an anti-pattern: they manange an _extra_ heap allocation which has nothing to do with the functionality of the map itself (khash manages the real buffers internally). In case there happens to be a reason to allocate the map structure itself later, this should be made explicit using xcalloc/xfree calls. --- src/nvim/extmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/extmark.c') diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index 510f3a4254..b4f22dbf33 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -260,7 +260,7 @@ bool extmark_clear(buf_T *buf, uint64_t ns_id, } uint64_t id; ssize_t decor_id; - map_foreach((&delete_set), id, decor_id, { + map_foreach(&delete_set, id, decor_id, { mtpos_t pos = marktree_lookup(buf->b_marktree, id, itr); assert(itr->node); marktree_del_itr(buf->b_marktree, itr, false); -- cgit