Skip to content

Commit

Permalink
Core: equiv remove len variable at array checks
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Aug 16, 2022
1 parent 9d07248 commit d2915d7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/equiv.js
Expand Up @@ -101,13 +101,12 @@ const callbacks = {
},

array(a, b) {
const len = a.length;
if (len !== b.length) {
if (a.length !== b.length) {
// Safe and faster
return false;
}

for (let i = 0; i < len; i++) {
for (let i = 0; i < a.length; i++) {
// Compare non-containers; queue non-reference-equal containers
if (!breadthFirstCompareChild(a[i], b[i])) {
return false;
Expand Down

0 comments on commit d2915d7

Please sign in to comment.