From: Susant Sahani Date: Mon, 18 Jan 2021 20:52:58 +0000 (+0100) Subject: core: transaction - use hashmap_ensure_put X-Git-Tag: v248-rc1~306^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acf56b72f26609ee5431e23d4e5bbaf7f730d236;p=thirdparty%2Fsystemd.git core: transaction - use hashmap_ensure_put --- diff --git a/src/core/transaction.c b/src/core/transaction.c index ae77bae65ed..d7388e2367a 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -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; }