Skip to content

Commit 74f50d7

Browse files
style(javascript): shorten the comment over the branch marking
Two lines, as the lib/ review instruction asks, keeping what the code cannot say: a chain holds one branch per disjunction, and acorn nests the walk.
1 parent 7d26d35 commit 74f50d7

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎lib/javascript/regexp.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ class BranchID {
6464
* @returns {boolean} whether the two are alternatives of one disjunction
6565
*/
6666
separatedFrom(alt) {
67-
// WHY: a chain holds at most one branch per disjunction — siblings share
68-
// a parent, so a chain takes one of them — so marking each disjunction
69-
// this chain passed answers the whole comparison in one walk of the
70-
// other. acorn walks one chain per node of the other, which is quadratic
71-
// in the nesting depth and re-walked per same-named group (acorn#1445).
67+
// A chain holds one branch per disjunction, so marking this one answers
68+
// the comparison in a single walk of the other — acorn nests two (#1445).
7269
const walk = ++branchWalk;
7370
/** @type {BranchID | null} */
7471
let self = this;

0 commit comments

Comments
 (0)