Permalink
Browse files

Since Unicode characters in IRC nicks aren't really an issue, this av…

…oids the regex.
  • Loading branch information...
ljharb committed Sep 23, 2012
1 parent 35ff619 commit a4412230aa6ce695cfa0b9aad3cfbc67c3d644e0
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/factoidserv/index.js
View
@@ -10,9 +10,9 @@ var FactoidServer = module.exports = function(filename) {
};
var caseInsensitiveDeDupingInsert = function (array, value) {
- var regex = new RegExp('^' + value + '$', 'i');
+ var valueLower = value.toLowerCase();
var found = array.some(function (item, index) {
- if (regex.test(item)) {
+ if (valueLower === item.toLowerCase()) {
array[index] = value;
return true;
});

0 comments on commit a441223

Please sign in to comment.