From acf56b72f26609ee5431e23d4e5bbaf7f730d236 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Mon, 18 Jan 2021 21:52:58 +0100 Subject: [PATCH] core: transaction - use hashmap_ensure_put --- src/core/transaction.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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; }