From 2d3cbc53cc90e12eba4ded9713a9926370aebedc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 20 Jan 2020 14:06:11 +0100 Subject: [PATCH] dbwrap: Do direct struct initalization in db_ctdb_store_db_seqnum() Save a few lines Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/lib/dbwrap/dbwrap_ctdb.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index 6d2a8c839eb..84ea015f385 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -749,14 +749,8 @@ static NTSTATUS db_ctdb_store_db_seqnum(struct db_ctdb_transaction_handle *h, uint64_t seqnum) { NTSTATUS status; - const char *keyname = CTDB_DB_SEQNUM_KEY; - TDB_DATA key; - TDB_DATA data; - - key = string_term_tdb_data(keyname); - - data.dptr = (uint8_t *)&seqnum; - data.dsize = sizeof(uint64_t); + TDB_DATA key = string_term_tdb_data(CTDB_DB_SEQNUM_KEY); + TDB_DATA data = { .dptr=(uint8_t *)&seqnum, .dsize=sizeof(seqnum) }; status = db_ctdb_transaction_store(h, key, data);