From 2214f9c19daa46a1fc37bcc14c017c092894a506 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Sat, 3 Feb 2024 12:57:03 +0600 Subject: refactor(options): remove `set_string_option_direct()` Problem: `set_string_option_direct()` contains a separate codepath specifically for setting string options. Not only is that unnecessary code duplication, but it's also limited to only string options. Solution: Replace `set_string_option_direct()` with `set_option_direct()` which calls `set_option()` under the hood. This reduces code duplication and allows directly setting an option of any type. --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/quickfix.c') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 0f639bf86a..9f431556e8 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -5154,7 +5154,7 @@ void ex_cfile(exarg_T *eap) } } if (*eap->arg != NUL) { - set_string_option_direct(kOptErrorfile, eap->arg, 0, 0); + set_option_direct(kOptErrorfile, CSTR_AS_OPTVAL(eap->arg), 0, 0); } char *enc = (*curbuf->b_p_menc != NUL) ? curbuf->b_p_menc : p_menc; -- cgit