This PR refactors some source files to pass string length to function dict_add_string_len() where it is known or can be calculated simply.
In addition:
In textprop.c, in function prop_fill_dict() use a string_T to store local variable text_align.
In popupwin.c, use a string_T to store struct member pp_name in struct poppos_entry_T.
In mark.c, refactor function add_mark() to pass in the length of argument mname.
In insexpand.c:
->Use a string_T to store the elements of static array ctrl_x_mode_names.
->Refactor function trigger_complete_done_event():
->->change type of argument char_u *word to string_T *word.
->->make one access of array ctrl_x_mode_names instead of two.
->Refactor function ins_compl_mode() to accept a string_T to return the resulting string.
In fileio.c:
->Refactor function getftypewfd() to accept a string_T to return the resulting string.
->In function create_readdirex_item() use a string_T to store local variable q.
In cmdexpand.c, store global cmdline_orig as a string_T.
In autocmd.c, in function f_autocmd_get() use a string_T to store local variables event_name and group_name. Measure their lengths once when they are assigned so they are not remeasured on each call to dict_add_string() in the subsequent for loop.
In channel.c, in function channel_part_info() drop local variable status and use s instead. Make s a string_T.
Cheers
John
https://github.com/vim/vim/pull/19999
(18 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@basilisk0315 pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@mao-yining commented on this pull request.
In src/popupwin.c:
> break;
}
- dict_add_string(dict, "close", (char_u *)(
- wp->w_popup_close == POPCLOSE_BUTTON ? "button"
- : wp->w_popup_close == POPCLOSE_CLICK ? "click" : "none"));
+ if (wp->w_popup_close == POPCLOSE_BUTTON)
+ dict_add_string_len(dict, "close", (char_u *)"button", STRLEN_LITERAL("button"));
+ else if (wp->w_popup_close == POPCLOSE_BUTTON)
⬇️ Suggested change
- else if (wp->w_popup_close == POPCLOSE_BUTTON) + else if (wp->w_popup_close == POPCLOSE_CLICK)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()