Skip to content

Commit a3958d0

Browse files
notriddleJoshua Nelson
and
Joshua Nelson
authored
Use Array.prototype.filter instead of open-coding
Part of #79052, originally suggested in #79052 (comment) Co-authored-by: Joshua Nelson <[email protected]>
1 parent 44e3daf commit a3958d0

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/librustdoc/html/static/main.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,7 @@ function defocusSearchBar() {
667667
results = {}, results_in_args = {}, results_returned = {},
668668
split = valLower.split("::");
669669

670-
var length = split.length;
671-
for (var z = 0; z < length; ++z) {
672-
if (split[z] === "") {
673-
split.splice(z, 1);
674-
z -= 1;
675-
}
676-
}
670+
split = split.filter(function(segment) { return segment !== ""; });
677671

678672
function transformResults(results, isType) {
679673
var out = [];

0 commit comments

Comments
 (0)