mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#4649 polish code
This commit is contained in:
parent
ebac7f7149
commit
0fb7f72448
@ -428,12 +428,12 @@ var Search = {
|
|||||||
var valid = true;
|
var valid = true;
|
||||||
|
|
||||||
// check if all requirements are matched
|
// check if all requirements are matched
|
||||||
var filteredTerms = // as search terms with length < 3 are discarded: ignore
|
var filteredTermCount = // as search terms with length < 3 are discarded: ignore
|
||||||
searchterms.filter(function(term){return term.length > 2}).length
|
searchterms.filter(function(term){return term.length > 2}).length
|
||||||
var allRequirementsMatched = fileMap[file].length != searchterms.length &&
|
if (
|
||||||
fileMap[file].length != filteredTerms
|
fileMap[file].length != searchterms.length &&
|
||||||
if (allRequirementsMatched)
|
fileMap[file].length != filteredTermCount
|
||||||
continue;
|
) continue;
|
||||||
|
|
||||||
// ensure that none of the excluded terms is in the search result
|
// ensure that none of the excluded terms is in the search result
|
||||||
for (i = 0; i < excluded.length; i++) {
|
for (i = 0; i < excluded.length; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user