fix defragment bug

This commit is contained in:
Hongze Cheng 2022-03-26 11:25:18 +00:00
parent dbec5f1fa4
commit 938b3a41d5
1 changed files with 2 additions and 2 deletions

View File

@ -372,11 +372,11 @@ static int tdbPageDefragment(SPage *pPage) {
int idx;
int iCell;
ASSERT(pPage->pFreeEnd - pPage->pFreeStart < nFree);
nFree = TDB_PAGE_NFREE(pPage);
nCells = TDB_PAGE_NCELLS(pPage);
ASSERT(pPage->pFreeEnd - pPage->pFreeStart < nFree);
// Loop to compact the page content
// Here we use an O(n^2) algorithm to do the job since
// this is a low frequency job.