sysv-generator: don't check first if hashmap contains the service name
Just test if hashmap_get returns null. hashmap_contains does exactly same thing internally so this is slightly more efficient for the true case. Silences a coverity warning too. CID#1237648
This commit is contained in:
@@ -810,9 +810,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (hashmap_contains(all_services, name))
|
||||
service = hashmap_get(all_services, name);
|
||||
else {
|
||||
service = hashmap_get(all_services, name);
|
||||
if (!service){
|
||||
log_warning("Could not find init script for %s", name);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user