/ Check-in [6ab42934]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Slightly smaller and faster implementation of OP_If and OP_IfNot.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:6ab42934e2c4957b5d8927bf4434a9db07ab6078987a6a2d25f35cc468d21203
User & Date: drh 2018-01-25 01:20:29
Context
2018-01-25
20:50
Reorganize zipfile.c code to make it easier to add support for in-memory zip archive processing. check-in: 30b92582 user: dan tags: trunk
01:20
Slightly smaller and faster implementation of OP_If and OP_IfNot. check-in: 6ab42934 user: drh tags: trunk
2018-01-24
20:42
When unpacking a sorter record, do so from right to left instead of left to right, since by starting with the right-most column, the work done by OP_Column opcodes is reduced. check-in: 8055e4f4 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  2285   2285   case OP_If:                 /* jump, in1 */
  2286   2286   case OP_IfNot: {            /* jump, in1 */
  2287   2287     int c;
  2288   2288     pIn1 = &aMem[pOp->p1];
  2289   2289     if( pIn1->flags & MEM_Null ){
  2290   2290       c = pOp->p3;
  2291   2291     }else{
  2292         -#ifdef SQLITE_OMIT_FLOATING_POINT
  2293         -    c = sqlite3VdbeIntValue(pIn1)!=0;
  2294         -#else
  2295         -    c = sqlite3VdbeRealValue(pIn1)!=0.0;
  2296         -#endif
         2292  +    if( pIn1->flags & MEM_Int ){
         2293  +      c = pIn1->u.i!=0;
         2294  +    }else{
         2295  +      c = sqlite3VdbeRealValue(pIn1)!=0.0;
         2296  +    }
  2297   2297       if( pOp->opcode==OP_IfNot ) c = !c;
  2298   2298     }
  2299   2299     VdbeBranchTaken(c!=0, 2);
  2300   2300     if( c ){
  2301   2301       goto jump_to_p2;
  2302   2302     }
  2303   2303     break;