refactor(options): remove OPT_FREE (#26963)

Problem: `OPT_FREE` macro doesn't seem to do anything as `P_ALLOCED`
already handles allocations.

Solution: Remove `OPT_FREE`.
This commit is contained in:
Famiu Haque
2024-01-10 04:15:22 +06:00
committed by GitHub
parent 501cf32357
commit 10f36af84d
15 changed files with 34 additions and 39 deletions

View File

@@ -1611,7 +1611,7 @@ failed:
save_file_ff(curbuf);
// If editing a new file: set 'fenc' for the current buffer.
// Also for ":read ++edit file".
set_string_option_direct(kOptFileencoding, fenc, OPT_FREE | OPT_LOCAL, 0);
set_string_option_direct(kOptFileencoding, fenc, OPT_LOCAL, 0);
}
if (fenc_alloced) {
xfree(fenc);
@@ -1959,7 +1959,7 @@ void set_forced_fenc(exarg_T *eap)
}
char *fenc = enc_canonize(eap->cmd + eap->force_enc);
set_string_option_direct(kOptFileencoding, fenc, OPT_FREE|OPT_LOCAL, 0);
set_string_option_direct(kOptFileencoding, fenc, OPT_LOCAL, 0);
xfree(fenc);
}