-C Use\smemcmp()\sinstead\sof\sthe\sBINARY\scollating\sfunction\swhere\spossible,\sfor\na\sperformance\sboost.
-D 2013-12-06T22:45:31.452
+C Performance\soptimization\sto\sthe\smoveToRoot()\ssubroutine\sin\sbtree.c.
+D 2013-12-06T23:25:27.601
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/backup.c 1809a7caa2504233bdddd12f5018422421789537
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
-F src/btree.c 1c1228bfeff3142c3d30f37f41c62e1e1456a04b
+F src/btree.c 4037f58ef3f4459d0b9bb1fc1aee1136277d9ba6
F src/btree.h a61ddebc78c66795a2b93181321a116746302cc9
F src/btreeInt.h f038e818bfadf75afbd09819ed93c26a333d39e0
F src/build.c 9b40580b62916612678bdb69ce0286e39c29a862
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P 2d62d1131f8bbc4e1f8f7aeaf0d91e3237fe3b7c
-R 64ecaeb699cffb8c7d50ef92ad2b85dd
+P c5a3a1af3c7bd34886e944a1fef2f6340ded24a0
+R 12065e363c2320b45db52efcb2788f0d
U drh
-Z 924fa8368d7b3d9057325dee3400f3cb
+Z 6564d15f297e6c8ddf25ac421a3f69fc
-c5a3a1af3c7bd34886e944a1fef2f6340ded24a0
\ No newline at end of file
+b5842a70f8e26456a8f0d39539bc266f097480a4
\ No newline at end of file
static int moveToRoot(BtCursor *pCur){
MemPage *pRoot;
int rc = SQLITE_OK;
- Btree *p = pCur->pBtree;
- BtShared *pBt = p->pBt;
assert( cursorHoldsMutex(pCur) );
assert( CURSOR_INVALID < CURSOR_REQUIRESEEK );
}
if( pCur->iPage>=0 ){
- int i;
- for(i=1; i<=pCur->iPage; i++){
- releasePage(pCur->apPage[i]);
- }
- pCur->iPage = 0;
+ while( pCur->iPage ) releasePage(pCur->apPage[pCur->iPage--]);
}else if( pCur->pgnoRoot==0 ){
pCur->eState = CURSOR_INVALID;
return SQLITE_OK;
}else{
- rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->apPage[0],
+ rc = getAndInitPage(pCur->pBtree->pBt, pCur->pgnoRoot, &pCur->apPage[0],
pCur->wrFlag==0 ? PAGER_GET_READONLY : 0);
if( rc!=SQLITE_OK ){
pCur->eState = CURSOR_INVALID;
pCur->atLast = 0;
pCur->validNKey = 0;
- if( pRoot->nCell==0 && !pRoot->leaf ){
+ if( pRoot->nCell>0 ){
+ pCur->eState = CURSOR_VALID;
+ }else if( !pRoot->leaf ){
Pgno subpage;
if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
pCur->eState = CURSOR_VALID;
rc = moveToChild(pCur, subpage);
}else{
- pCur->eState = ((pRoot->nCell>0)?CURSOR_VALID:CURSOR_INVALID);
+ pCur->eState = CURSOR_INVALID;
}
return rc;
}