Skip to content

Commit

Permalink
Combine loops that iterate a.entries() for Map. This eliminates unnec…
Browse files Browse the repository at this point in the history
…essary extra iteration of entries.
  • Loading branch information
darcyparker committed Jun 4, 2021
1 parent a8e7172 commit b0ce91d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.jst
Expand Up @@ -24,10 +24,10 @@ module.exports = function equal(a, b) {
{{? it.es6 }}
if ((a instanceof Map) && (b instanceof Map)) {
if (a.size !== b.size) return false;
for (i of a.entries())
for (i of a.entries()) {
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
}
return true;
}

Expand Down

0 comments on commit b0ce91d

Please sign in to comment.