tree-wide: port over more cases to STR_IN_SET()

This commit is contained in:
Lennart Poettering 2018-11-23 16:31:04 +01:00
parent 49fe5c0996
commit 0cbd293e12
2 changed files with 2 additions and 5 deletions

View File

@ -1852,9 +1852,7 @@ char *cg_escape(const char *p) {
* needs free()! */
if (IN_SET(p[0], 0, '_', '.') ||
streq(p, "notify_on_release") ||
streq(p, "release_agent") ||
streq(p, "tasks") ||
STR_IN_SET(p, "notify_on_release", "release_agent", "tasks") ||
startswith(p, "cgroup."))
need_prefix = true;
else {

View File

@ -1183,8 +1183,7 @@ static bool file_has_type_prefix(const char *prefix, const char *filename) {
tilded = strjoina(full, "~");
atted = strjoina(prefix, "@");
return streq(filename, full) ||
streq(filename, tilded) ||
return STR_IN_SET(filename, full, tilded) ||
startswith(filename, atted);
}