From 6a146bed26610340ad085b69a3b9a038623ebe9d Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Thu, 10 Mar 2022 20:31:37 +0100 Subject: [PATCH] db: small code cleanup Changelog-None: db: small code cleanup Signed-off-by: Vincenzo Palazzo --- db/exec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/db/exec.c b/db/exec.c index 77c9597ab..13341c1e7 100644 --- a/db/exec.c +++ b/db/exec.c @@ -78,13 +78,9 @@ s64 db_get_intvar(struct db *db, char *varname, s64 defval) struct db_stmt *stmt = db_prepare_v2( db, SQL("SELECT intval FROM vars WHERE name= ? LIMIT 1")); db_bind_text(stmt, 0, varname); - if (!db_query_prepared(stmt)) - goto done; - - if (db_step(stmt)) + if (db_query_prepared(stmt) && db_step(stmt)) res = db_col_int(stmt, "intval"); -done: tal_free(stmt); return res; }