From 1e351b9a7c5d7aa4c1dd65ba3f3ef3b45ac5689a Mon Sep 17 00:00:00 2001 From: Gokulakrishna Date: Mon, 28 May 2018 15:13:33 +0530 Subject: For ExcludeMatch, switched regex.exec to regex.test As per Mozilla documentation, regex test() is faster than exec(). For ExcludeMatch, we just need to see true or false, that can be done faster with test() for large exclude patterns. --- js/redirect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/redirect.js b/js/redirect.js index 75f000d..ac06ff7 100644 --- a/js/redirect.js +++ b/js/redirect.js @@ -266,7 +266,7 @@ Redirect.prototype = { if (!this._rxExclude) { return false; } - var shouldExclude = !!this._rxExclude.exec(url); + var shouldExclude = this._rxExclude.test(url); this._rxExclude.lastIndex = 0; return shouldExclude; } -- cgit v1.2.3