network: route - Use hashmap_ensure_put
This commit is contained in:
committed by
Susant Sahani
parent
b9eea0a753
commit
ecd80ce26c
@@ -227,11 +227,7 @@ static int route_new_static(Network *network, const char *filename, unsigned sec
|
||||
route->network = network;
|
||||
route->section = TAKE_PTR(n);
|
||||
|
||||
r = hashmap_ensure_allocated(&network->routes_by_section, &network_config_hash_ops);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = hashmap_put(network->routes_by_section, route->section, route);
|
||||
r = hashmap_ensure_put(&network->routes_by_section, &network_config_hash_ops, route->section, route);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user