Use config cache for completion.web_history.exclude

On my machine, this speeds up regenerating from ~6min to ~25s.
This commit is contained in:
Florian Bruhin 2018-09-06 16:17:23 +02:00
parent 108cc65bc6
commit cd8fd8ab3c

View File

@ -151,8 +151,8 @@ class WebHistory(sql.SqlTable):
def _is_excluded(self, url):
"""Check if the given URL is excluded from the completion."""
return any(pattern.matches(url)
for pattern in config.val.completion.web_history.exclude)
patterns = config.cache['completion.web_history.exclude']
return any(pattern.matches(url) for pattern in patterns)
def _rebuild_completion(self):
data = {'url': [], 'title': [], 'last_atime': []}