Skip to content

Commit 5e64f35

Browse files
author
Erlend E. Aasland
committed
Reduce unneeded if nesting
1 parent 2d28a2a commit 5e64f35

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Modules/_sqlite/cursor.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,12 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
546546

547547
/* We start a transaction implicitly before a DML statement.
548548
SELECT is the only exception. See #9924. */
549-
if (self->connection->begin_statement && self->statement->is_dml) {
550-
if (sqlite3_get_autocommit(self->connection->db)) {
551-
if (begin_transaction(self->connection) < 0) {
552-
goto error;
553-
}
549+
if (self->connection->begin_statement
550+
&& self->statement->is_dml
551+
&& sqlite3_get_autocommit(self->connection->db))
552+
{
553+
if (begin_transaction(self->connection) < 0) {
554+
goto error;
554555
}
555556
}
556557

0 commit comments

Comments
 (0)