Use Array.prototype.filter instead of open-coding
Part of #79052, originally suggested in https://github.com/rust-lang/rust/pull/79052#discussion_r523468743 Co-authored-by: Joshua Nelson <joshua@yottadb.com>
This commit is contained in:
parent
44e3daf5ee
commit
a3958d039d
@ -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 = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user