From e1282a63d6e41d437dd1b14a08baf89b78ab56cc Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 4 Dec 2021 19:31:43 +0100 Subject: finish implementing more efficient querying of URL patterns The algorithm is implemented and tested. However, it is yet to be hooked into the actual extension. --- common/patterns.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/patterns.js') diff --git a/common/patterns.js b/common/patterns.js index 5d84a73..7d28dfe 100644 --- a/common/patterns.js +++ b/common/patterns.js @@ -96,7 +96,7 @@ function deconstruct_url(url, use_limits=true) throw `unsupported protocol in url '${url}'`; } - deco.trailing_dash = deco.path[deco.path.length - 1] === "/"; + deco.trailing_slash = deco.path[deco.path.length - 1] === "/"; if (deco.domain) { if (deco.domain.length > max.DOMAIN_CHARS) { @@ -151,7 +151,7 @@ function* each_path_pattern(deco) const path_part = ["", ...deco.path.slice(0, slice)].join("/"); const path_wildcards = []; if (slice === deco.path.length && !deco.path_truncated) { - if (deco.trailing_dash) + if (deco.trailing_slash) yield path_part + "/"; if (slice > 0 || deco.proto !== "file") yield path_part; -- cgit v1.2.3