1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Move an "if( rc==SQLITE_OK )" to outside a loop body in the fts5 bm25() code.

FossilOrigin-Name: 14a4dcf3474566d072007a37d214c892397c21dd3b7f8b55ad0e5edfb7130dd6
This commit is contained in:
dan
2020-11-27 16:05:31 +00:00
parent 1c5b23f170
commit 66efc393c5
3 changed files with 14 additions and 12 deletions

View File

@ -673,11 +673,13 @@ static void fts5Bm25Function(
}
/* Determine the BM25 score for the current row. */
for(i=0; rc==SQLITE_OK && i<pData->nPhrase; i++){
score += pData->aIDF[i] * (
( aFreq[i] * (k1 + 1.0) ) /
( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) )
);
if( rc==SQLITE_OK ){
for(i=0; i<pData->nPhrase; i++){
score += pData->aIDF[i] * (
( aFreq[i] * (k1 + 1.0) ) /
( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) )
);
}
}
/* If no error has occurred, return the calculated score. Otherwise,