From cee0403b5c05a98fe960eba4c36fc61492da8a77 Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Fri, 15 Nov 2019 00:45:08 +0100 Subject: [PATCH] Code cleanup to remove douplacte var definition Also move the declaration outside the loop since they accumulate state with each iteration --- src/librustdoc/html/static/main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index bdbcc6b3527..752b93f2ac5 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1081,14 +1081,13 @@ function getSearchElement() { val = paths[paths.length - 1]; var contains = paths.slice(0, paths.length > 1 ? paths.length - 1 : 1); + var lev; + var lev_distance; for (j = 0; j < nSearchWords; ++j) { - var lev; - var lev_distance; ty = searchIndex[j]; if (!ty || (filterCrates !== undefined && ty.crate !== filterCrates)) { continue; } - var lev_distance; var lev_add = 0; if (paths.length > 1) { lev = checkPath(contains, paths[paths.length - 1], ty);