Skip to content

Commit d38527e

Browse files
committed
rustdoc: clean up search.js by removing empty sort case
It's going to be a no-op on the empty list anyway (we have plenty of test cases that return nothing) so why send extra code?
1 parent 7f427f8 commit d38527e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/librustdoc/html/static/js/search.js

-5
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,6 @@ function initSearch(rawSearchIndex) {
13211321
* @returns {[ResultObject]}
13221322
*/
13231323
function sortResults(results, isType, preferredCrate) {
1324-
// if there are no results then return to default and fail
1325-
if (results.size === 0) {
1326-
return [];
1327-
}
1328-
13291324
const userQuery = parsedQuery.userQuery;
13301325
const result_list = [];
13311326
for (const result of results.values()) {

0 commit comments

Comments
 (0)