tree-wide: use strv_extend_strv_consume() where appropriate

This commit is contained in:
Mike Yuan
2024-09-21 00:53:50 +02:00
parent 8a7ade7427
commit a2c8652a2a
20 changed files with 54 additions and 113 deletions
+3 -7
View File
@@ -106,13 +106,9 @@ int unit_load_dropin(Unit *u) {
if (r <= 0)
return 0;
if (!u->dropin_paths)
u->dropin_paths = TAKE_PTR(l);
else {
r = strv_extend_strv(&u->dropin_paths, l, true);
if (r < 0)
return log_oom();
}
r = strv_extend_strv_consume(&u->dropin_paths, TAKE_PTR(l), /* filter_duplicates = */ true);
if (r < 0)
return log_oom();
u->dropin_mtime = 0;
STRV_FOREACH(f, u->dropin_paths) {