diff options
| author | Michael Howell <michael@notriddle.com> | 2023-12-15 13:28:43 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-12-15 16:26:35 -0700 |
| commit | 6b69ebcae0170c16e64d77939e47e3412c1637eb (patch) | |
| tree | 10a61fe20bd6efec526a13be432ce5d7b410927f /src/tools/rustdoc-js/tester.js | |
| parent | e6707df0de337976dce7577e68fc57adcd5e4842 (diff) | |
| download | rust-6b69ebcae0170c16e64d77939e47e3412c1637eb.tar.gz rust-6b69ebcae0170c16e64d77939e47e3412c1637eb.zip | |
rustdoc-search: remove parallel searchWords array
This might have made sense if the algorithm could use `searchWords` to skip having to look at `searchIndex`, but since it always does a substring check on both the stock word and the normalizedName, it doesn't seem to help performance anyway.
Diffstat (limited to 'src/tools/rustdoc-js/tester.js')
| -rw-r--r-- | src/tools/rustdoc-js/tester.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/rustdoc-js/tester.js b/src/tools/rustdoc-js/tester.js index 6e630a80454..86881ef362e 100644 --- a/src/tools/rustdoc-js/tester.js +++ b/src/tools/rustdoc-js/tester.js @@ -396,16 +396,16 @@ function loadSearchJS(doc_folder, resource_suffix) { const staticFiles = path.join(doc_folder, "static.files"); const searchJs = fs.readdirSync(staticFiles).find(f => f.match(/search.*\.js$/)); const searchModule = require(path.join(staticFiles, searchJs)); - const searchWords = searchModule.initSearch(searchIndex.searchIndex); + searchModule.initSearch(searchIndex.searchIndex); return { doSearch: function(queryStr, filterCrate, currentCrate) { - return searchModule.execQuery(searchModule.parseQuery(queryStr), searchWords, + return searchModule.execQuery(searchModule.parseQuery(queryStr), filterCrate, currentCrate); }, getCorrections: function(queryStr, filterCrate, currentCrate) { const parsedQuery = searchModule.parseQuery(queryStr); - searchModule.execQuery(parsedQuery, searchWords, filterCrate, currentCrate); + searchModule.execQuery(parsedQuery, filterCrate, currentCrate); return parsedQuery.correction; }, parseQuery: searchModule.parseQuery, |
