tree-wide: use set_ensure_put()
Patch contains a coccinelle script, but it only works in some cases. Many parts were converted by hand. Note: I did not fix errors in return value handing. This will be done separate to keep the patch comprehensible. No functional change is intended in this patch.
This commit is contained in:
@@ -3196,11 +3196,7 @@ static int link_parent(ItemArray *a) {
|
||||
if (!j)
|
||||
j = ordered_hashmap_get(globs, prefix);
|
||||
if (j) {
|
||||
r = set_ensure_allocated(&j->children, NULL);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
r = set_put(j->children, a);
|
||||
r = set_ensure_put(&j->children, NULL, a);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user