mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
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:
parent
d62d8b9111
commit
4be01e7000
@ -266,7 +266,7 @@ def main(args):
|
||||
|
||||
for c in chars:
|
||||
if '-' in c:
|
||||
parts = [x.strip() for x in c.split('-')]
|
||||
parts = tuple(x.strip() for x in c.split('-'))
|
||||
if len(parts) != 2:
|
||||
prints('Invalid range:', c, file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
@ -274,7 +274,7 @@ def main(args):
|
||||
parts = tuple(map(conv_code, parts))
|
||||
for i in parts:
|
||||
not_single(i)
|
||||
ranges.add(tuple(parts))
|
||||
ranges.add(parts)
|
||||
else:
|
||||
if opts.codes:
|
||||
c = conv_code(c)
|
||||
|
Loading…
x
Reference in New Issue
Block a user