Skip to content

Commit

Permalink
Use Array.prototype.filter instead of open-coding
Browse files Browse the repository at this point in the history
Part of rust-lang#79052, originally suggested in rust-lang#79052 (comment)

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
  • Loading branch information
notriddle and Joshua Nelson authored Jan 1, 2021
1 parent 44e3daf commit a3958d0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,7 @@ function defocusSearchBar() {
results = {}, results_in_args = {}, results_returned = {},
split = valLower.split("::");

var length = split.length;
for (var z = 0; z < length; ++z) {
if (split[z] === "") {
split.splice(z, 1);
z -= 1;
}
}
split = split.filter(function(segment) { return segment !== ""; });

function transformResults(results, isType) {
var out = [];
Expand Down

0 comments on commit a3958d0

Please sign in to comment.