Rollup merge of #98230 - GuillaumeGomez:weird-js-condition, r=notriddle

Fix weird js condition

While going around the code, I found this weird condition. Fixing also affects the generated results in some cases apparently (could only find this one).

Any idea maybe `@notriddle?`

r? `@notriddle`
This commit is contained in:
Matthias Krüger 2022-06-19 00:17:16 +02:00 committed by GitHub
commit 267fe3bf81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -1333,10 +1333,7 @@ function initSearch(rawSearchIndex) {
if (searchWord.indexOf(elem.pathLast) > -1 || if (searchWord.indexOf(elem.pathLast) > -1 ||
row.normalizedName.indexOf(elem.pathLast) > -1 row.normalizedName.indexOf(elem.pathLast) > -1
) { ) {
// filter type: ... queries index = row.normalizedName.indexOf(elem.pathLast);
if (!results_others[fullId] !== undefined) {
index = row.normalizedName.indexOf(elem.pathLast);
}
} }
lev = levenshtein(searchWord, elem.pathLast); lev = levenshtein(searchWord, elem.pathLast);
if (lev > 0 && elem.pathLast.length > 2 && searchWord.indexOf(elem.pathLast) > -1) { if (lev > 0 && elem.pathLast.length > 2 && searchWord.indexOf(elem.pathLast) > -1) {