1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Minor performance improvements.

FossilOrigin-Name: f9950c6af1813f724dacd7455f472acec921b06a
This commit is contained in:
drh
2011-05-30 23:42:16 +00:00
parent f4b595b929
commit c3f1d5f095
5 changed files with 30 additions and 26 deletions

View File

@@ -5390,10 +5390,10 @@ static int fillInCell(
** "sz" must be the number of bytes in the cell.
*/
static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){
int i; /* Loop counter */
u32 pc; /* Offset to cell content of cell being deleted */
u8 *data; /* pPage->aData */
u8 *ptr; /* Used to move bytes around within data[] */
u8 *endPtr; /* End of loop */
int rc; /* The return code */
int hdr; /* Beginning of the header. 0 most pages. 100 page 1 */
@@ -5418,9 +5418,11 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){
*pRC = rc;
return;
}
for(i=idx+1; i<pPage->nCell; i++, ptr+=2){
endPtr = &data[pPage->cellOffset + 2*pPage->nCell - 2];
while( ptr<endPtr ){
ptr[0] = ptr[2];
ptr[1] = ptr[3];
ptr += 2;
}
pPage->nCell--;
put2byte(&data[hdr+3], pPage->nCell);