perf(api): elide luaref copy when setting 'callback' in nvim_set_keymap

This commit is contained in:
Björn Linse 2022-01-01 16:41:16 +01:00
parent a5eadbaf3c
commit 9f489f591d

View File

@ -606,7 +606,8 @@ void modify_keymap(Buffer buffer, bool is_unmap, String mode, String lhs, String
}
if (opts != NULL && opts->callback.type == kObjectTypeLuaRef) {
lua_funcref = api_new_luaref(opts->callback.data.luaref);
lua_funcref = opts->callback.data.luaref;
opts->callback.data.luaref = LUA_NOREF;
}
MapArguments parsed_args = MAP_ARGUMENTS_INIT;
if (opts) {