Regex optimisation suggested by @Skeeve

This commit is contained in:
Jermolene 2013-12-20 18:14:11 +00:00
parent e66fb948c1
commit bd80bf4acc
1 changed files with 1 additions and 1 deletions

View File

@ -940,7 +940,7 @@ exports.search = function(text,options) {
searchTermsRegExps = [new RegExp("(" + $tw.utils.escapeRegExp(text) + ")",flags)];
}
} else {
terms = text.replace(/( +)/g," ").split(" ");
terms = text.split(/ +/);
if(terms.length === 1 && terms[0] === "") {
searchTermsRegExps = null;
} else {