Removed unneeded if statements
This commit is contained in:
@@ -222,24 +222,21 @@ destruct_esqlite_connection(ErlNifEnv *env, void *arg)
|
|||||||
/* The thread has finished... now remove the command queue, and close
|
/* The thread has finished... now remove the command queue, and close
|
||||||
* the database (if it was still open).
|
* the database (if it was still open).
|
||||||
*/
|
*/
|
||||||
while(queue_has_item(db->commands)) command_destroy(queue_pop(db->commands));
|
while(queue_has_item(db->commands)) {
|
||||||
|
command_destroy(queue_pop(db->commands));
|
||||||
|
}
|
||||||
queue_destroy(db->commands);
|
queue_destroy(db->commands);
|
||||||
|
|
||||||
if(db->db) {
|
sqlite3_close_v2(db->db);
|
||||||
sqlite3_close_v2(db->db);
|
db->db = NULL;
|
||||||
db->db = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
destruct_esqlite_statement(ErlNifEnv *env, void *arg)
|
destruct_esqlite_statement(ErlNifEnv *env, void *arg)
|
||||||
{
|
{
|
||||||
esqlite_statement *stmt = (esqlite_statement *) arg;
|
esqlite_statement *stmt = (esqlite_statement *) arg;
|
||||||
|
sqlite3_finalize(stmt->statement);
|
||||||
if(stmt->statement) {
|
stmt->statement = NULL;
|
||||||
sqlite3_finalize(stmt->statement);
|
|
||||||
stmt->statement = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ERL_NIF_TERM
|
static ERL_NIF_TERM
|
||||||
|
|||||||
Reference in New Issue
Block a user