Skip to content

Commit

Permalink
plugins.rules: replace map with generator comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoopJ authored and dgw committed Jun 21, 2023
1 parent 58783fb commit 098d8c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sopel/plugins/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def _compile_pattern(pattern, nick, aliases=None):
if aliases:
nicks = list(aliases) # alias_nicks.copy() doesn't work in py2
nicks.append(nick)
nicks = map(re.escape, nicks)
nick = '(?:%s)' % '|'.join(nicks)
nick = '(?:%s)' % '|'.join(re.escape(n) for n in nicks)
else:
nick = re.escape(nick)

Expand Down

0 comments on commit 098d8c3

Please sign in to comment.