1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Avoid re.split as it's a bit less efficient and a bit harder to read.

This commit is contained in:
Toshio Kuratomi 2017-10-25 19:38:08 -07:00
parent e07cbb033f
commit e8c599b0f7

View file

@ -91,7 +91,7 @@ def split_host_pattern(pattern):
# If it's got commas in it, we'll treat it as a straightforward
# comma-separated list of patterns.
if ',' in pattern:
patterns = re.split('\s*,\s*', pattern)
patterns = pattern.split(',')
# If it doesn't, it could still be a single pattern. This accounts for
# non-separator uses of colons: IPv6 addresses and [x:y] host ranges.