Explorar o código

build_filter: micro opt / easier code, fixes #3390

Thomas Waldmann %!s(int64=2) %!d(string=hai) anos
pai
achega
8060d4100a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/borg/archiver/_common.py

+ 1 - 1
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: