about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-01-06 13:45:52 -0700
committerMichael Howell <michael@notriddle.com>2024-03-11 21:22:03 -0700
commitd38527eb82fd10ee5578b541b06904611f6f8427 (patch)
tree27dfa5e92b9b67c5c6d5e4249ce2fee0968ddb1a /src
parent7f427f86bd0db622f896bcdce04ce5f20658c071 (diff)
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?
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/js/search.js5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index 1e163367b51..f8d1714e866 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -1321,11 +1321,6 @@ function initSearch(rawSearchIndex) {
          * @returns {[ResultObject]}
          */
         function sortResults(results, isType, preferredCrate) {
-            // if there are no results then return to default and fail
-            if (results.size === 0) {
-                return [];
-            }
-
             const userQuery = parsedQuery.userQuery;
             const result_list = [];
             for (const result of results.values()) {