Rearrange code in fts5_expr.c so that synonym support does not slow down the common case.
FossilOrigin-Name: 801882817f1d895aef1426f9a7196bd140b807c3
This commit is contained in:
@@ -1181,10 +1181,17 @@ static int fts5ExprNodeNext(
|
||||
};
|
||||
|
||||
case FTS5_TERM: {
|
||||
rc = fts5ExprNearAdvanceFirst(pExpr, pNode, bFromValid, iFrom);
|
||||
if( pNode->bEof==0 ){
|
||||
Fts5IndexIter *pIter = pNode->pNear->apPhrase[0]->aTerm[0].pIter;
|
||||
if( bFromValid ){
|
||||
rc = sqlite3Fts5IterNextFrom(pIter, iFrom);
|
||||
}else{
|
||||
rc = sqlite3Fts5IterNext(pIter);
|
||||
}
|
||||
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){
|
||||
assert( rc==SQLITE_OK );
|
||||
rc = fts5ExprTokenTest(pExpr, pNode);
|
||||
}else{
|
||||
pNode->bEof = 1;
|
||||
}
|
||||
return rc;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user