From 3593fa60f2a1549a09335e88ca7553f548f07ad8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 8 Jan 2020 12:23:57 +0100 Subject: [PATCH] path-util: express PATH_IN_SET() through path_strv_contains() --- src/basic/path-util.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 3e8c12481be..f49a876f3d2 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -71,17 +71,7 @@ static inline bool path_equal_ptr(const char *a, const char *b) { } /* Note: the search terminates on the first NULL item. */ -#define PATH_IN_SET(p, ...) \ - ({ \ - char **_s; \ - bool _found = false; \ - STRV_FOREACH(_s, STRV_MAKE(__VA_ARGS__)) \ - if (path_equal(p, *_s)) { \ - _found = true; \ - break; \ - } \ - _found; \ - }) +#define PATH_IN_SET(p, ...) path_strv_contains(STRV_MAKE(__VA_ARGS__), p) char* path_startswith_strv(const char *p, char **set); #define PATH_STARTSWITH_SET(p, ...) path_startswith_strv(p, STRV_MAKE(__VA_ARGS__)) -- 2.47.3