Skip to content

Commit

Permalink
Fix major oopsie
Browse files Browse the repository at this point in the history
`compare` was actually comparing `a` with `a`, meaning the check passes for *any* two strings of the same length.
  • Loading branch information
daguej committed Mar 30, 2015
1 parent ebd5a87 commit dd1ff1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function compare (a, b) {
}

for (var i = 0, il = a.length; i < il; ++i) {
mismatch |= (a.charCodeAt(i) ^ a.charCodeAt(i));
mismatch |= (a.charCodeAt(i) ^ b.charCodeAt(i));
}

return mismatch === 0;
};
};

1 comment on commit dd1ff1a

@schoenbergerb
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the best commit ever, u made my day 😅

Please # to comment.