aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/treesitter.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-05-17 13:00:32 +0200
committerGitHub <noreply@github.com>2023-05-17 13:00:32 +0200
commit67176c3f20cf8f0b6c7d7c4d75093ea6b7c00b74 (patch)
treec1a0e185985227f05f1da2480de74739c779dfaf /src/nvim/lua/treesitter.c
parent189fb6203262340e7a59e782be970bcd8ae28e61 (diff)
parente2fdd53d8c015913e8be4ff708fc3488558c8906 (diff)
downloadrneovim-67176c3f20cf8f0b6c7d7c4d75093ea6b7c00b74.tar.gz
rneovim-67176c3f20cf8f0b6c7d7c4d75093ea6b7c00b74.tar.bz2
rneovim-67176c3f20cf8f0b6c7d7c4d75093ea6b7c00b74.zip
Merge pull request #15534 from bfredl/monomap
refactor(map): avoid duplicated khash_t implementations for values and support sets
Diffstat (limited to 'src/nvim/lua/treesitter.c')
-rw-r--r--src/nvim/lua/treesitter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c
index 96e104cd48..a9e7838980 100644
--- a/src/nvim/lua/treesitter.c
+++ b/src/nvim/lua/treesitter.c
@@ -241,9 +241,9 @@ int tslua_remove_lang(lua_State *L)
const char *lang_name = luaL_checkstring(L, 1);
bool present = pmap_has(cstr_t)(&langs, lang_name);
if (present) {
- char *key = (char *)pmap_key(cstr_t)(&langs, lang_name);
- pmap_del(cstr_t)(&langs, lang_name);
- xfree(key);
+ cstr_t key;
+ pmap_del(cstr_t)(&langs, lang_name, &key);
+ xfree((void *)key);
}
lua_pushboolean(L, present);
return 1;