aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2024-10-27 19:09:24 +0600
committerGitHub <noreply@github.com>2024-10-27 13:09:24 +0000
commitb136a9ee4c5689c655713ab006be84ae9e7a313a (patch)
tree7a8c3ad0edb5f4e144069301727a49f34b388305 /src/nvim/quickfix.c
parent123c0b6b4e2d3f0665774b70b6bec79afbef4509 (diff)
downloadrneovim-b136a9ee4c5689c655713ab006be84ae9e7a313a.tar.gz
rneovim-b136a9ee4c5689c655713ab006be84ae9e7a313a.tar.bz2
rneovim-b136a9ee4c5689c655713ab006be84ae9e7a313a.zip
refactor(options): always allocate option values (#30917)
Instead of keeping `P_ALLOCED` and `P_DEF_ALLOCED` flags to check if an option value is allocated, always allocate option values to simplify the logic. Ref: #25672
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 5bd81ce469..f037d5d924 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -7348,7 +7348,6 @@ void ex_helpgrep(exarg_T *eap)
bool updated = false;
// Make 'cpoptions' empty, the 'l' flag should not be used here.
char *const save_cpo = p_cpo;
- const bool save_cpo_allocated = (get_option(kOptCpoptions)->flags & P_ALLOCED);
p_cpo = empty_string_option;
bool new_qi = false;
@@ -7388,9 +7387,7 @@ void ex_helpgrep(exarg_T *eap)
if (*p_cpo == NUL) {
set_option_value_give_err(kOptCpoptions, CSTR_AS_OPTVAL(save_cpo), 0);
}
- if (save_cpo_allocated) {
- free_string_option(save_cpo);
- }
+ free_string_option(save_cpo);
}
if (updated) {