util: Make in_charset a static inline in util.h

With in_charset now reduced to a one-liner (plus asserts), make it a
static inline.
This commit is contained in:
Josh Triplett 2014-03-11 18:51:17 -07:00 committed by Lennart Poettering
parent e0333c7314
commit 01f83c1c76
2 changed files with 5 additions and 7 deletions

View File

@ -920,12 +920,6 @@ char *delete_chars(char *s, const char *bad) {
return s;
}
bool in_charset(const char *s, const char* charset) {
assert(s);
assert(charset);
return s[strspn(s, charset)] == '\0';
}
char *file_in_same_dir(const char *path, const char *filename) {
char *e, *r;
size_t k;

View 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);