use tuple up front instead of list which must later be converted to tuple

We don't need a mutable type, anyway, and the only other use of it is
recreating the list as = tuple(map(...)) so why convert *again* to a
tuple?
This commit is contained in:
Eli Schwartz 2020-02-23 01:40:02 -05:00
parent d62d8b9111
commit 4be01e7000
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -266,7 +266,7 @@ def main(args):
for c in chars: for c in chars:
if '-' in c: if '-' in c:
parts = [x.strip() for x in c.split('-')] parts = tuple(x.strip() for x in c.split('-'))
if len(parts) != 2: if len(parts) != 2:
prints('Invalid range:', c, file=sys.stderr) prints('Invalid range:', c, file=sys.stderr)
raise SystemExit(1) raise SystemExit(1)
@ -274,7 +274,7 @@ def main(args):
parts = tuple(map(conv_code, parts)) parts = tuple(map(conv_code, parts))
for i in parts: for i in parts:
not_single(i) not_single(i)
ranges.add(tuple(parts)) ranges.add(parts)
else: else:
if opts.codes: if opts.codes:
c = conv_code(c) c = conv_code(c)