Skip to content

Commit

Permalink
In sqlite3VdbeHalt(), return as soon as possible if
Browse files Browse the repository at this point in the history
Vdbe.magic!=VDBE_MAGIC_RUN. This makes sqlite3_reset() slightly faster in some
cases.
  • Loading branch information
danielk-1977 committed Feb 21, 2017
1 parent a695e8d commit 70cf569
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vdbeaux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2609,13 +2609,13 @@ int sqlite3VdbeHalt(Vdbe *p){
** one, or the complete transaction if there is no statement transaction.
*/

if( p->magic!=VDBE_MAGIC_RUN ){
return SQLITE_OK;
}
if( db->mallocFailed ){
p->rc = SQLITE_NOMEM_BKPT;
}
closeAllCursors(p);
if( p->magic!=VDBE_MAGIC_RUN ){
return SQLITE_OK;
}
checkActiveVdbeCnt(db);

/* No commit or rollback needed if the program never started or if the
Expand Down

0 comments on commit 70cf569

Please sign in to comment.