mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Small performance improvement on sqlite3BtreeMoveto. (CVS 2934)
FossilOrigin-Name: c780152f3cff9c0a13d231935ae3c2e2d28b4460
This commit is contained in:
10
src/btree.c
10
src/btree.c
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.293 2006/01/12 15:01:16 drh Exp $
|
||||
** $Id: btree.c,v 1.294 2006/01/13 02:35:10 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@@ -2901,8 +2901,7 @@ static int getPayload(
|
||||
pageIntegrity(pPage);
|
||||
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
|
||||
getCellInfo(pCur);
|
||||
aPayload = pCur->info.pCell;
|
||||
aPayload += pCur->info.nHeader;
|
||||
aPayload = pCur->info.pCell + pCur->info.nHeader;
|
||||
if( pPage->intKey ){
|
||||
nKey = 0;
|
||||
}else{
|
||||
@@ -3326,6 +3325,7 @@ int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
|
||||
void *pCellKey;
|
||||
i64 nCellKey;
|
||||
pCur->idx = (lwr+upr)/2;
|
||||
pCur->info.nSize = 0;
|
||||
if( pPage->intKey ){
|
||||
u8 *pCell = findCell(pPage, pCur->idx);
|
||||
pCell += pPage->childPtrSize;
|
||||
@@ -3334,7 +3334,6 @@ int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
|
||||
pCell += getVarint32(pCell, &dummy);
|
||||
}
|
||||
getVarint(pCell, &nCellKey);
|
||||
pCur->info.nSize = 0;
|
||||
if( nCellKey<nKey ){
|
||||
c = -1;
|
||||
}else if( nCellKey>nKey ){
|
||||
@@ -3344,9 +3343,8 @@ int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
|
||||
}
|
||||
}else{
|
||||
int available;
|
||||
parseCell(pPage, pCur->idx, &pCur->info);
|
||||
nCellKey = pCur->info.nKey;
|
||||
pCellKey = (void *)fetchPayload(pCur, &available, 0);
|
||||
nCellKey = pCur->info.nKey;
|
||||
if( available>=nCellKey ){
|
||||
c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey);
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user