about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-06 04:13:35 +0100
committerGitHub <noreply@github.com>2022-02-06 04:13:35 +0100
commitb7287e9e4f2541635ed09412c823d9711014e1c8 (patch)
tree0403cab0b5e16b87fc169a4f692cc899a446f18f
parent9a5e937d743266bb2b4ac5c6f4ae4e3972d45bb2 (diff)
parentca4296dcfee60b456b21fed4d619a6ff21f35442 (diff)
downloadrust-b7287e9e4f2541635ed09412c823d9711014e1c8.tar.gz
rust-b7287e9e4f2541635ed09412c823d9711014e1c8.zip
Rollup merge of #93659 - UltiRequiem:refactor_conditional_static_rustdoc, r=GuillaumeGomez
Refactor conditional

Merge two `if` in just one.
-rw-r--r--src/librustdoc/html/static/js/search.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index 8c832a222b7..0aaa3b7c179 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -587,11 +587,8 @@ window.initSearch = function(rawSearchIndex) {
         }
 
         function typePassesFilter(filter, type) {
-            // No filter
-            if (filter <= NO_TYPE_FILTER) return true;
-
-            // Exact match
-            if (filter === type) return true;
+            // No filter or Exact mach
+            if (filter <= NO_TYPE_FILTER || filter === type) return true;
 
             // Match related items
             var name = itemTypes[type];