refactor: use S_LEN(s) instead of s, n (#29219)

This commit is contained in:
James
2024-06-11 22:40:24 +07:00
committed by GitHub
parent 44410d063a
commit c37695a5d5
42 changed files with 263 additions and 258 deletions

View File

@@ -294,7 +294,7 @@ void ex_profile(exarg_T *eap)
int len = (int)(e - eap->arg);
e = skipwhite(e);
if (len == 5 && strncmp(eap->arg, "start", 5) == 0 && *e != NUL) {
if (len == 5 && strncmp(eap->arg, S_LEN("start")) == 0 && *e != NUL) {
xfree(profile_fname);
profile_fname = expand_env_save_opt(e, true);
do_profiling = PROF_YES;
@@ -369,12 +369,12 @@ void set_context_in_profile_cmd(expand_T *xp, const char *arg)
return;
}
if ((end_subcmd - arg == 5 && strncmp(arg, "start", 5) == 0)
|| (end_subcmd - arg == 4 && strncmp(arg, "file", 4) == 0)) {
if ((end_subcmd - arg == 5 && strncmp(arg, S_LEN("start")) == 0)
|| (end_subcmd - arg == 4 && strncmp(arg, S_LEN("file")) == 0)) {
xp->xp_context = EXPAND_FILES;
xp->xp_pattern = skipwhite(end_subcmd);
return;
} else if (end_subcmd - arg == 4 && strncmp(arg, "func", 4) == 0) {
} else if (end_subcmd - arg == 4 && strncmp(arg, S_LEN("func")) == 0) {
xp->xp_context = EXPAND_USER_FUNC;
xp->xp_pattern = skipwhite(end_subcmd);
return;