From dd1ff1ac0122de7e0af4f00c61ed73261062394a Mon Sep 17 00:00:00 2001 From: Josh Dague Date: Mon, 30 Mar 2015 14:36:10 -0700 Subject: [PATCH] Fix major oopsie `compare` was actually comparing `a` with `a`, meaning the check passes for *any* two strings of the same length. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1cfd91b..1ffa759 100755 --- a/index.js +++ b/index.js @@ -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; -}; \ No newline at end of file +};