mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
refactor(object): get rid of redundant FIXED_TEMP_ARRAY
use the MAXSIZE_TEMP_ARRAY + ADD_C pattern instead, as exemplified by the changes in this commit.
This commit is contained in:
@@ -538,9 +538,9 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In
|
||||
Integer end_row, Integer end_col, ArrayOf(String) replacement, Error *err)
|
||||
FUNC_API_SINCE(7)
|
||||
{
|
||||
FIXED_TEMP_ARRAY(scratch, 1);
|
||||
MAXSIZE_TEMP_ARRAY(scratch, 1);
|
||||
if (replacement.size == 0) {
|
||||
scratch.items[0] = STRING_OBJ(STATIC_CSTR_AS_STRING(""));
|
||||
ADD_C(scratch, STRING_OBJ(STATIC_CSTR_AS_STRING("")));
|
||||
replacement = scratch;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user