1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-03-25 04:46:55 +00:00

Regex optimisation suggested by @Skeeve

This commit is contained in:
Jermolene 2013-12-20 18:14:11 +00:00
parent e66fb948c1
commit bd80bf4acc

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 {