Skip to content

Commit 54bd4c2

Browse files
committed
perf: merge multiple filter calls into one
1 parent 1543f1c commit 54bd4c2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/rules/no-multiple-template-root.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ module.exports = {
5050
return
5151
}
5252

53-
const comments = element.comments.filter((comment) =>
54-
utils.inRange(element, comment)
55-
)
56-
const reportComments = comments.filter(
53+
const reportComments = element.comments.filter(
5754
(comment) =>
55+
utils.inRange(element, comment) &&
5856
!element.children.some((child) => utils.inRange(child, comment))
5957
)
6058
if (disallowComments) {

0 commit comments

Comments
 (0)