Skip to content

Commit

Permalink
Remove unneeded array
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Aug 21, 2023
1 parent f0b7a7c commit ff5d50f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/linter/code-path-analysis/code-path-segment.js
Expand Up @@ -233,7 +233,6 @@ class CodePathSegment {
*/
static flattenUnusedSegments(segments) {
const done = new Set();
const retv = [];

for (let i = 0; i < segments.length; ++i) {
const segment = segments[i];
Expand All @@ -250,16 +249,14 @@ class CodePathSegment {

if (!done.has(prevSegment)) {
done.add(prevSegment);
retv.push(prevSegment);
}
}
} else {
done.add(segment);
retv.push(segment);
}
}

return retv;
return [...done];
}
}

Expand Down

0 comments on commit ff5d50f

Please sign in to comment.