chiark / gitweb /
util: Make in_charset a static inline in util.h
[elogind.git] / src / shared / util.h
index cc52ae750387371ae2dbc0d74b02b613fa393f32..81831e277154996b76be4e11dbf1edb5f8748963 100644 (file)
@@ -531,7 +531,11 @@ char *strjoin(const char *x, ...) _sentinel_;
 
 bool is_main_thread(void);
 
-bool in_charset(const char *s, const char* charset) _pure_;
+static inline bool _pure_ in_charset(const char *s, const char* charset) {
+        assert(s);
+        assert(charset);
+        return s[strspn(s, charset)] == '\0';
+}
 
 int block_get_whole_disk(dev_t d, dev_t *ret);