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:
dan
2015-09-03 19:48:02 +00:00
parent cce413202a
commit f8efe64649
3 changed files with 16 additions and 9 deletions
+9 -2
View File
@@ -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;
};