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:
Thomas Hindoe Paaboel Andersen
2014-09-17 23:11:58 +02:00
parent 2b2332856b
commit 8c84621c25
+2 -3
View File
@@ -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;
}