提交 1e8e6e32 编写于 作者: H Hongze Cheng 提交者: cpwu

refact

上级 1a2506af
......@@ -1277,11 +1277,6 @@ static int tdbBtcMoveToNext(SBTC *pBtc) {
return 0;
}
int tdbBtcClose(SBTC *pBtc) {
// TODO
return 0;
}
static int tdbBtcMoveDownward(SBTC *pBtc, SPgno pgno) {
int ret;
......@@ -1310,8 +1305,27 @@ static int tdbBtcMoveUpward(SBTC *pBtc) {
return 0;
}
int tdbBtcClose(SBTC *pBtc) {
if (pBtc->iPage < 0) return 0;
for (;;) {
ASSERT(pBtc->pPage);
tdbPagerReturnPage(pBtc->pBt->pPager, pBtc->pPage);
pBtc->iPage--;
if (pBtc->iPage < 0) break;
pBtc->pPage = pBtc->pgStack[pBtc->iPage];
pBtc->idx = pBtc->idxStack[pBtc->iPage];
}
return 0;
}
// TDB_BTREE_CURSOR
// TDB_BTREE_DEBUG =====================
#ifndef NODEBUG
typedef struct {
SPgno pgno;
......@@ -1342,4 +1356,5 @@ void tdbBtPageInfo(SPage *pPage, int idx) {
pBtPageInfo->nCells = TDB_PAGE_TOTAL_CELLS(pPage) - pPage->nOverflow;
pBtPageInfo->nOvfl = pPage->nOverflow;
}
#endif
\ No newline at end of file
#endif
// TDB_BTREE_DEBUG
\ No newline at end of file
......@@ -35,7 +35,6 @@ struct SBTC {
int idx;
int idxStack[BTREE_MAX_DEPTH + 1];
SPage *pgStack[BTREE_MAX_DEPTH + 1];
void *pBuf;
};
// SBTree
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册