aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-07-13 14:55:35 +0200
committerGitHub <noreply@github.com>2024-07-13 14:55:35 +0200
commit2ad84286375112524e118a4f6ced68782b285a52 (patch)
tree7c5ababfadc6ce9904728ac76b2cd21a8536ef0a /src
parentb0f39f3ef5502c037b5bdb0da3d45d312b7fdc2a (diff)
parent970a27927eb31bdc735f0d7d5e3d07784486c6de (diff)
downloadrneovim-2ad84286375112524e118a4f6ced68782b285a52.tar.gz
rneovim-2ad84286375112524e118a4f6ced68782b285a52.tar.bz2
rneovim-2ad84286375112524e118a4f6ced68782b285a52.zip
Merge pull request #29659 from amitds1997/fix/empty-dict-encoding
fix(lua)!: do not use typed table for empty dict
Diffstat (limited to 'src')
-rw-r--r--src/nvim/lua/converter.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c
index c8ad6606bf..c879d731bc 100644
--- a/src/nvim/lua/converter.c
+++ b/src/nvim/lua/converter.c
@@ -703,14 +703,10 @@ void nlua_push_Boolean(lua_State *lstate, const Boolean b, int flags)
void nlua_push_Dictionary(lua_State *lstate, const Dictionary dict, int flags)
FUNC_ATTR_NONNULL_ALL
{
- if (dict.size == 0 && (flags & kNluaPushSpecial)) {
- nlua_create_typed_table(lstate, 0, 0, kObjectTypeDictionary);
- } else {
- lua_createtable(lstate, 0, (int)dict.size);
- if (dict.size == 0 && !(flags & kNluaPushSpecial)) {
- nlua_pushref(lstate, nlua_global_refs->empty_dict_ref);
- lua_setmetatable(lstate, -2);
- }
+ lua_createtable(lstate, 0, (int)dict.size);
+ if (dict.size == 0) {
+ nlua_pushref(lstate, nlua_global_refs->empty_dict_ref);
+ lua_setmetatable(lstate, -2);
}
for (size_t i = 0; i < dict.size; i++) {
nlua_push_String(lstate, dict.items[i].key, flags);