From 8060d4100a6549fe9527d4bb403cb7acaf1fd4fe Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 7 Apr 2023 18:21:17 +0200 Subject: [PATCH] build_filter: micro opt / easier code, fixes #3390 --- src/borg/archiver/_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/archiver/_common.py b/src/borg/archiver/_common.py index 376d4ec31..00729e221 100644 --- a/src/borg/archiver/_common.py +++ b/src/borg/archiver/_common.py @@ -591,7 +591,7 @@ def build_filter(matcher, strip_components): if strip_components: def item_filter(item): - matched = matcher.match(item.path) and os.sep.join(item.path.split(os.sep)[strip_components:]) + matched = matcher.match(item.path) and len(item.path.split(os.sep)) > strip_components return matched else: