From: Tim Duesterhus Date: Tue, 19 May 2020 11:49:39 +0000 (+0200) Subject: CLEANUP: vars: Remove void vars_unset_by_name(const char*, size_t, struct sample*) X-Git-Tag: v2.2-dev9~199 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7329327333d48332638b9c2d8fc81fb0702d7d16;p=thirdparty%2Fhaproxy.git CLEANUP: vars: Remove void vars_unset_by_name(const char*, size_t, struct sample*) With "MINOR: lua: Use vars_unset_by_name_ifexist()" the last user was removed and as outlined in that commit there is no good reason for this function to exist. May be backported together with the commit mentioned above. --- diff --git a/include/proto/vars.h b/include/proto/vars.h index 6152f5c8b2..caf00ff685 100644 --- a/include/proto/vars.h +++ b/include/proto/vars.h @@ -10,7 +10,6 @@ int vars_get_by_name(const char *name, size_t len, struct sample *smp); void vars_set_by_name_ifexist(const char *name, size_t len, struct sample *smp); void vars_set_by_name(const char *name, size_t len, struct sample *smp); void vars_unset_by_name_ifexist(const char *name, size_t len, struct sample *smp); -void vars_unset_by_name(const char *name, size_t len, struct sample *smp); int vars_get_by_desc(const struct var_desc *var_desc, struct sample *smp); int vars_check_arg(struct arg *arg, char **err); diff --git a/src/vars.c b/src/vars.c index a6807facdf..08b1307f19 100644 --- a/src/vars.c +++ b/src/vars.c @@ -584,21 +584,6 @@ void vars_unset_by_name_ifexist(const char *name, size_t len, struct sample *smp } -/* This function unset a variable. - * In error case, it fails silently. - */ -void vars_unset_by_name(const char *name, size_t len, struct sample *smp) -{ - enum vars_scope scope; - - /* Resolve name and scope. */ - name = register_name(name, len, &scope, 1, NULL); - if (!name) - return; - - sample_clear_stream(name, scope, smp); -} - /* this function fills a sample with the * variable content. Returns 1 if the sample * is filled, otherwise it returns 0.