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

Minor optimization on clearCell()

FossilOrigin-Name: f3c39c2986be08683c2af4df610bc12e3c6bc6bec265c94ce01b94a950723524
This commit is contained in:
drh
2017-08-02 18:27:50 +00:00
parent 85ef630fde
commit 60172a5a93
3 changed files with 9 additions and 8 deletions

View File

@@ -6117,7 +6117,7 @@ static int clearCell(
unsigned char *pCell, /* First byte of the Cell */
CellInfo *pInfo /* Size information about the cell */
){
BtShared *pBt = pPage->pBt;
BtShared *pBt;
Pgno ovflPgno;
int rc;
int nOvfl;
@@ -6133,6 +6133,7 @@ static int clearCell(
return SQLITE_CORRUPT_PGNO(pPage->pgno);
}
ovflPgno = get4byte(pCell + pInfo->nSize - 4);
pBt = pPage->pBt;
assert( pBt->usableSize > 4 );
ovflPageSize = pBt->usableSize - 4;
nOvfl = (pInfo->nPayload - pInfo->nLocal + ovflPageSize - 1)/ovflPageSize;