core: transaction - use hashmap_ensure_put

This commit is contained in:
Susant Sahani
2021-01-18 21:52:58 +01:00
parent f334debabb
commit acf56b72f2

View File

@@ -648,11 +648,7 @@ static int transaction_apply(
assert(!j->transaction_prev);
assert(!j->transaction_next);
r = hashmap_ensure_allocated(&m->jobs, NULL);
if (r < 0)
return r;
r = hashmap_put(m->jobs, UINT32_TO_PTR(j->id), j);
r = hashmap_ensure_put(&m->jobs, NULL, UINT32_TO_PTR(j->id), j);
if (r < 0)
goto rollback;
}