compile regex only once in filte inside regex condition

This commit is contained in:
Ben Sarmiento
2023-10-28 21:21:50 +02:00
parent 5326746f0c
commit a0a5be6bff
2 changed files with 1 additions and 60 deletions

View File

@@ -111,8 +111,8 @@ func (z *ZurgConfigV1) matchFilter(fileID, torrentName string, fileNames []strin
}
}
if filter.FileInsideRegexStr != "" {
regex := compilePattern(filter.FileInsideRegexStr)
for _, filename := range fileNames {
regex := compilePattern(filter.FileInsideRegexStr)
if regex.MatchString(filename) {
return true
}