From: Ralph Boehme Date: Sat, 18 Aug 2018 07:12:21 +0000 (+0200) Subject: dbwrap_tdb: move a function call out of an if condition X-Git-Tag: tdb-1.3.17~1640 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a9620bb4252a76385284092a1497920e86b34eb;p=thirdparty%2Fsamba.git dbwrap_tdb: move a function call out of an if condition At least for me this improves readability somewhat. No change in behaviour. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c index f59764535a2..19f2f009c0c 100644 --- a/lib/dbwrap/dbwrap_tdb.c +++ b/lib/dbwrap/dbwrap_tdb.c @@ -116,13 +116,16 @@ static struct db_record *db_tdb_fetch_locked_internal( struct db_tdb_ctx *ctx = talloc_get_type_abort(db->private_data, struct db_tdb_ctx); struct tdb_fetch_locked_state state; + int ret; state.mem_ctx = mem_ctx; state.result = NULL; - if ((tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse, - &state) < 0) && - (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) { + ret = tdb_parse_record(ctx->wtdb->tdb, + key, + db_tdb_fetchlock_parse, + &state); + if ((ret < 0) && (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) { tdb_chainunlock(ctx->wtdb->tdb, key); return NULL; }