aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-01-03 15:24:41 +0100
committerbfredl <bjorn.linse@gmail.com>2023-01-03 17:31:54 +0100
commitb2295ac4ec80e141628cea33ebee81c96e168989 (patch)
treeee197c75d19b1922d9a1149f8b5e1b7a12a76c70 /src/nvim/ui.c
parent5b22b32e50858b781eb2658ba099eaffaa5ea13b (diff)
downloadrneovim-b2295ac4ec80e141628cea33ebee81c96e168989.tar.gz
rneovim-b2295ac4ec80e141628cea33ebee81c96e168989.tar.bz2
rneovim-b2295ac4ec80e141628cea33ebee81c96e168989.zip
refactor(api): do not allocate temporaries for internal events
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r--src/nvim/ui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 4c640693cc..4c2e3a8993 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -227,9 +227,9 @@ void ui_refresh(void)
if (ui_client_attached) {
// TODO(bfredl): ui_refresh() should only be used on the server
// we are in the client process. forward the resize
- Array args = ARRAY_DICT_INIT;
- ADD(args, INTEGER_OBJ((int)width));
- ADD(args, INTEGER_OBJ((int)height));
+ MAXSIZE_TEMP_ARRAY(args, 2);
+ ADD_C(args, INTEGER_OBJ((int)width));
+ ADD_C(args, INTEGER_OBJ((int)height));
rpc_send_event(ui_client_channel_id, "nvim_ui_try_resize", args);
} else {
/// TODO(bfredl): Messy! The screen does not yet exist, but we need to