/ Check-in [2ce11667]
Login

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

Overview
Comment:Remove some unused legacy code from the btree insert logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2ce1166717ac3c0cec37b2f6d70d8359fbaefc71
User & Date: drh 2016-05-21 19:10:21
Context
2016-05-21
20:03
Simplify the sqlite3BtreeInsert() interface by gathering the five arguments describing the content to be inserted into the new BtreePayload structure, and thus reducing the number of parameters from eight to four. check-in: 55f348cd user: drh tags: trunk
19:10
Remove some unused legacy code from the btree insert logic. check-in: 2ce11667 user: drh tags: trunk
12:29
Yet another minor size reduction and performance increase in the b-tree insert logic. check-in: 1dbaf7a1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/btree.c.

6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
....
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
  }
  nHeader += putVarint(&pCell[nHeader], *(u64*)&nKey);
  
  /* Fill in the payload size */
  if( pPage->intKey ){
    pSrc = pData;
    nSrc = nData;
    nData = 0;
  }else{ 
    assert( nKey<=0x7fffffff && pKey!=0 );
    nPayload = (int)nKey;
    pSrc = pKey;
    nSrc = (int)nKey;
  }
  if( nPayload<=pPage->maxLocal ){
................................................................................
      memset(pPayload, 0, n);
    }
    nPayload -= n;
    pPayload += n;
    pSrc += n;
    nSrc -= n;
    spaceLeft -= n;
    if( nSrc==0 ){
      nSrc = nData;
      pSrc = pData;
    }
  }
  releasePage(pToRelease);
  return SQLITE_OK;
}

/*
** Remove the i-th cell from pPage.  This routine effects pPage only.







<







 







<
<
<
<







6107
6108
6109
6110
6111
6112
6113

6114
6115
6116
6117
6118
6119
6120
....
6235
6236
6237
6238
6239
6240
6241




6242
6243
6244
6245
6246
6247
6248
  }
  nHeader += putVarint(&pCell[nHeader], *(u64*)&nKey);
  
  /* Fill in the payload size */
  if( pPage->intKey ){
    pSrc = pData;
    nSrc = nData;

  }else{ 
    assert( nKey<=0x7fffffff && pKey!=0 );
    nPayload = (int)nKey;
    pSrc = pKey;
    nSrc = (int)nKey;
  }
  if( nPayload<=pPage->maxLocal ){
................................................................................
      memset(pPayload, 0, n);
    }
    nPayload -= n;
    pPayload += n;
    pSrc += n;
    nSrc -= n;
    spaceLeft -= n;




  }
  releasePage(pToRelease);
  return SQLITE_OK;
}

/*
** Remove the i-th cell from pPage.  This routine effects pPage only.