tree-wide: use _contains() rather than _get()/_find()

This commit is contained in:
Yu Watanabe
2026-03-02 23:10:22 +09:00
parent 8b3d3d6d67
commit 4b4eba1666
14 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -464,7 +464,7 @@ static int method_create_or_register_machine(
supervisor_pidref = TAKE_PIDREF(client_pidref);
}
if (hashmap_get(manager->machines, name))
if (hashmap_contains(manager->machines, name))
return sd_bus_error_setf(error, BUS_ERROR_MACHINE_EXISTS, "Machine '%s' already exists", name);
return machine_add_from_params(
@@ -616,7 +616,7 @@ static int method_create_or_register_machine_ex(
if (!isempty(root_directory) && (!path_is_absolute(root_directory) || !path_is_valid(root_directory)))
return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Root directory must be empty or an absolute path");
if (hashmap_get(manager->machines, name))
if (hashmap_contains(manager->machines, name))
return sd_bus_error_setf(error, BUS_ERROR_MACHINE_EXISTS, "Machine '%s' already exists", name);
/* If a PID is specified that's the leader, but if the client process is different from it, than that's the supervisor */
+1 -1
View File
@@ -174,7 +174,7 @@ int vl_method_resolve_record(
if (r == 0)
break;
nxdomain = !!hashmap_get(m->machines, q);
nxdomain = hashmap_contains(m->machines, q);
}
}