Skip to content

Commit

Permalink
Core: refactor equiv for easier readability
Browse files Browse the repository at this point in the history
Small removals/adjustments to make the code more readable.
  • Loading branch information
izelnakri committed Aug 16, 2022
1 parent ad1202f commit 9d07248
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/equiv.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ function breadthFirstCompareChild (a, b) {
// over the pair.
if (a === b) {
return true;
}
if (!isContainer(a)) {
} else if (!isContainer(a)) {
return typeEquiv(a, b);
}
if (pairs.every((pair) => pair.a !== a || pair.b !== b)) {
} else if (pairs.every((pair) => pair.a !== a || pair.b !== b)) {
// Not yet started comparing this pair
pairs.push({ a: a, b: b });
pairs.push({ a, b });
}
return true;
}
Expand Down Expand Up @@ -284,7 +282,7 @@ function innerEquiv (a, b) {
}

// Clear the global pair queue and add the top-level values being compared
pairs = [{ a: a, b: b }];
pairs = [{ a, b }];

for (let i = 0; i < pairs.length; i++) {
const pair = pairs[i];
Expand Down

0 comments on commit 9d07248

Please sign in to comment.