From 87699fe313cf8919917f2ea422b8d10b3ae3b244 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 9 Sep 2015 15:15:14 +0200 Subject: locale: kill free_and_replace() That function really makes little sense, as the open-coded variant is much more readable. Also, if the 2nd argument is NULL, mfree() is a much better candidate. Convert the only users of this function in localed, and then remove it entirely. --- src/basic/util.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/basic') diff --git a/src/basic/util.h b/src/basic/util.h index 0fafebd52d..8313675477 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -871,11 +871,6 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra int extract_first_word_and_warn(const char **p, char **ret, const char *separators, ExtractFlags flags, const char *unit, const char *filename, unsigned line, const char *rvalue); int extract_many_words(const char **p, const char *separators, ExtractFlags flags, ...) _sentinel_; -static inline void free_and_replace(char **s, char *v) { - free(*s); - *s = v; -} - int free_and_strdup(char **p, const char *s); #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1) -- cgit v1.2.3-54-g00ecf