Skip to content

Commit

Permalink
Make loop more clear by renaming variables
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 16, 2021
1 parent ba824ec commit 080b926
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,15 @@ window.initSearch = function(rawSearchIndex) {
if (input === "*") {
is_module = true;
} else {
var allFound = 0;
for (it = 0, len = inputs.length; allFound === 0 && it < len; it++) {
allFound = checkType(type, inputs[it], true);
var firstNonZeroDistance = 0;
for (it = 0, len = inputs.length; it < len; it++) {
var distance = checkType(type, inputs[it], true);
if (distance > 0) {
firstNonZeroDistance = distance;
break;
}
}
in_args = allFound;
in_args = firstNonZeroDistance;
}
addIntoResults(true, results_in_args, fullId, i, -1, in_args);
addIntoResults(true, results_returned, fullId, i, -1, returned);
Expand Down

0 comments on commit 080b926

Please sign in to comment.