mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Small size reduction and performance improvement in whereScanNext().
FossilOrigin-Name: d861ee17eb900a607de6ec3f4a5d5c24cfb834a0
This commit is contained in:
17
src/where.c
17
src/where.c
@@ -198,11 +198,14 @@ static WhereTerm *whereScanNext(WhereScan *pScan){
|
||||
WhereTerm *pTerm; /* The term being tested */
|
||||
int k = pScan->k; /* Where to start scanning */
|
||||
|
||||
while( pScan->iEquiv<=pScan->nEquiv ){
|
||||
iCur = pScan->aiCur[pScan->iEquiv-1];
|
||||
assert( pScan->iEquiv<=pScan->nEquiv );
|
||||
pWC = pScan->pWC;
|
||||
while(1){
|
||||
iColumn = pScan->aiColumn[pScan->iEquiv-1];
|
||||
if( iColumn==XN_EXPR && pScan->pIdxExpr==0 ) return 0;
|
||||
while( (pWC = pScan->pWC)!=0 ){
|
||||
iCur = pScan->aiCur[pScan->iEquiv-1];
|
||||
assert( pWC!=0 );
|
||||
do{
|
||||
for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){
|
||||
if( pTerm->leftCursor==iCur
|
||||
&& pTerm->u.leftColumn==iColumn
|
||||
@@ -252,15 +255,17 @@ static WhereTerm *whereScanNext(WhereScan *pScan){
|
||||
testcase( pTerm->eOperator & WO_IS );
|
||||
continue;
|
||||
}
|
||||
pScan->pWC = pWC;
|
||||
pScan->k = k+1;
|
||||
return pTerm;
|
||||
}
|
||||
}
|
||||
}
|
||||
pScan->pWC = pScan->pWC->pOuter;
|
||||
pWC = pWC->pOuter;
|
||||
k = 0;
|
||||
}
|
||||
pScan->pWC = pScan->pOrigWC;
|
||||
}while( pWC!=0 );
|
||||
if( pScan->iEquiv>=pScan->nEquiv ) break;
|
||||
pWC = pScan->pOrigWC;
|
||||
k = 0;
|
||||
pScan->iEquiv++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user