diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-01-21 10:07:34 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-01-21 10:07:34 +0100 |
commit | 2e5180d38b33710506ab76dcf93f802864b9ec0f (patch) | |
tree | d246a21a2b8b2b7119843b732b880973722844ca /src/basic/strv.h | |
parent | cdc6804b6046282a42117678751c126a022cd24a (diff) | |
download | systemd-2e5180d38b33710506ab76dcf93f802864b9ec0f.tar.gz |
strv: get rid of strv_clear()
Let's remove a function of questionnable utility.
strv_clear() frees the items of a string array, but not the array
itself. i.e. it half-drestructs a string array and makes it empty. This
is not too useful an operation since we almost never need to just do
that, we also want to free the whole thing. In fact, strv_clear() is
only used in one of our .c file, and there it appears like unnecessary
optimization, given that for each array with n elements it leaves the
number of free()s we need to at O(n) which is not really an optimization
at all (it goes from n+1 to n, that's all).
Prompted by the discussions on #14605
Diffstat (limited to 'src/basic/strv.h')
-rw-r--r-- | src/basic/strv.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/basic/strv.h b/src/basic/strv.h index 85a49ab5c3..e7c2b1a604 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -25,8 +25,6 @@ char **strv_free_erase(char **l); DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free_erase); #define _cleanup_strv_free_erase_ _cleanup_(strv_free_erasep) -void strv_clear(char **l); - char **strv_copy(char * const *l); size_t strv_length(char * const *l) _pure_; |