aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeaux.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-09-16 01:34:43 +0000
committerdrh <drh@noemail.net>2011-09-16 01:34:43 +0000
commit48f2d3b10a5ac48ae2a1a24f77c7cb1aab6ea978 (patch)
tree0b02d36b1ecb60c458133c090c14df3c131b6151 /src/vdbeaux.c
parent5b6a9ed49556deac6d48be80b6ef2816102f1951 (diff)
downloadsqlite-48f2d3b10a5ac48ae2a1a24f77c7cb1aab6ea978.tar.gz
sqlite-48f2d3b10a5ac48ae2a1a24f77c7cb1aab6ea978.zip
Add the new OP_Once opcode. Use it to clean up and simplify various
one-time initialization sections in the code, including the fix for ticket [002caede898ae]. FossilOrigin-Name: 7f00552b739fad79517b042a6ed61abe743a917b
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r--src/vdbeaux.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index b00768477..1d5f713af 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -670,18 +670,15 @@ void sqlite3VdbeLinkSubProgram(Vdbe *pVdbe, SubProgram *p){
}
/*
-** Change N opcodes starting at addr to No-ops.
+** Change the opcode at addr into OP_Noop
*/
-void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
+void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
if( p->aOp ){
VdbeOp *pOp = &p->aOp[addr];
sqlite3 *db = p->db;
- while( N-- ){
- freeP4(db, pOp->p4type, pOp->p4.p);
- memset(pOp, 0, sizeof(pOp[0]));
- pOp->opcode = OP_Noop;
- pOp++;
- }
+ freeP4(db, pOp->p4type, pOp->p4.p);
+ memset(pOp, 0, sizeof(pOp[0]));
+ pOp->opcode = OP_Noop;
}
}