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

Small performance improvement and size reduction in btree.

FossilOrigin-Name: daa07149c0a0fcb6a6a1ace6020ca68802588ed309f5aaaf99c871088bc46908
This commit is contained in:
drh
2022-11-19 18:17:40 +00:00
parent 8d0d409876
commit 47de1f9e19
3 changed files with 14 additions and 12 deletions

View File

@@ -7239,14 +7239,16 @@ struct CellArray {
** computed.
*/
static void populateCellCache(CellArray *p, int idx, int N){
MemPage *pRef = p->pRef;
u16 *szCell = p->szCell;
assert( idx>=0 && idx+N<=p->nCell );
while( N>0 ){
assert( p->apCell[idx]!=0 );
if( p->szCell[idx]==0 ){
p->szCell[idx] = p->pRef->xCellSize(p->pRef, p->apCell[idx]);
if( szCell[idx]==0 ){
szCell[idx] = pRef->xCellSize(pRef, p->apCell[idx]);
}else{
assert( CORRUPT_DB ||
p->szCell[idx]==p->pRef->xCellSize(p->pRef, p->apCell[idx]) );
szCell[idx]==pRef->xCellSize(pRef, p->apCell[idx]) );
}
idx++;
N--;