1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2018-08-18 09:12:21 +02:00 committed by Jeremy Allison
parent 6617b2db35
commit 9a9620bb42

View File

@ -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;
}