tree-wide: port over more cases to STR_IN_SET()
This commit is contained in:
parent
49fe5c0996
commit
0cbd293e12
|
@ -1852,9 +1852,7 @@ char *cg_escape(const char *p) {
|
||||||
* needs free()! */
|
* needs free()! */
|
||||||
|
|
||||||
if (IN_SET(p[0], 0, '_', '.') ||
|
if (IN_SET(p[0], 0, '_', '.') ||
|
||||||
streq(p, "notify_on_release") ||
|
STR_IN_SET(p, "notify_on_release", "release_agent", "tasks") ||
|
||||||
streq(p, "release_agent") ||
|
|
||||||
streq(p, "tasks") ||
|
|
||||||
startswith(p, "cgroup."))
|
startswith(p, "cgroup."))
|
||||||
need_prefix = true;
|
need_prefix = true;
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1183,8 +1183,7 @@ static bool file_has_type_prefix(const char *prefix, const char *filename) {
|
||||||
tilded = strjoina(full, "~");
|
tilded = strjoina(full, "~");
|
||||||
atted = strjoina(prefix, "@");
|
atted = strjoina(prefix, "@");
|
||||||
|
|
||||||
return streq(filename, full) ||
|
return STR_IN_SET(filename, full, tilded) ||
|
||||||
streq(filename, tilded) ||
|
|
||||||
startswith(filename, atted);
|
startswith(filename, atted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue