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

Change sqlite3BtreeNext() and sqlite3BtreePrevious() so that they return

SQLITE_DONE if they have already reached the end (or beginning) of the table.
This gives a performance increase and size reduction.

FossilOrigin-Name: e972a3860892022d57b26ec44ce0fbadc61c1ff54b7a10b7e82390db88d323a7
This commit is contained in:
drh
2017-05-30 18:34:07 +00:00
parent d26d2c7de2
commit 2ab792e4c0
9 changed files with 111 additions and 100 deletions

View File

@@ -306,7 +306,11 @@ static int SQLITE_TCLAPI btree_next(
}
pCur = sqlite3TestTextToPtr(argv[1]);
sqlite3BtreeEnter(pCur->pBtree);
rc = sqlite3BtreeNext(pCur, &res);
rc = sqlite3BtreeNext(pCur, 0);
if( rc==SQLITE_DONE ){
res = 1;
rc = SQLITE_OK;
}
sqlite3BtreeLeave(pCur->pBtree);
if( rc ){
Tcl_AppendResult(interp, sqlite3ErrName(rc), 0);