mirror of
https://github.com/beetbox/beets.git
synced 2026-01-25 09:38:19 +01:00
fix(fitintitle): simplify keyword_pattern using map() instead of list comprehension
This commit is contained in:
parent
3dd3bf5640
commit
2aa949e5a0
1 changed files with 1 additions and 3 deletions
|
|
@ -106,9 +106,7 @@ def find_bracket_position(
|
|||
pattern = None
|
||||
else:
|
||||
# Build regex pattern to support multi-word keywords/phrases.
|
||||
# Each keyword/phrase is escaped and surrounded by word boundaries at
|
||||
# start and end, matching phrases like "club mix" as a whole.
|
||||
keyword_pattern = "|".join(rf"\b{re.escape(kw)}\b" for kw in keywords)
|
||||
keyword_pattern = rf"\b{'|'.join(map(re.escape, keywords))}\b"
|
||||
pattern = re.compile(keyword_pattern, re.IGNORECASE)
|
||||
|
||||
# Bracket pairs (opening, closing)
|
||||
|
|
|
|||
Loading…
Reference in a new issue