Skip to content

Commit f0990ac

Browse files
committed
combine comment block index checks so they can short circuit
1 parent b479c4d commit f0990ac

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/parse/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ function findCorrectCommentBlockIndex(
4040
return comments.findIndex((comment) => {
4141
const { start: commentStart, end: commentEnd } = comment;
4242

43-
const check1 = (commentStart === start && commentEnd === end);
44-
const check2 = (commentStart === start + 1 && commentEnd === end - 1);
45-
const check3 = (commentStart === start + 7 && commentEnd === end - 1);
46-
47-
return check1 || check2 || check3;
43+
return (
44+
(commentStart === start && commentEnd === end) ||
45+
(commentStart === start + 1 && commentEnd === end - 1) ||
46+
(commentStart === start + 7 && commentEnd === end - 1)
47+
);
4848
});
4949

5050
}

0 commit comments

Comments
 (0)