mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-22 03:06:59 +03:00
Replaced list comprehension with generator
Creating a list here doesnt make sense when its almost instantly recreated.
This commit is contained in:
1 parent
31c049deda
commit
37c01c028c
1 file changed
+4
-2
@@ -82,8 +82,10 @@ try:
|
||||
# Get state from latest Journal file
|
||||
try:
|
||||
logdir = config.get('journaldir') or config.default_journal_dir
|
||||
logfiles = sorted([x for x in os.listdir(logdir) if re.search('^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$', x)],
|
||||
key=lambda x: x.split('.')[1:])
|
||||
logfiles = sorted(
|
||||
(x for x in os.listdir(logdir) if re.search('^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$', x)),
|
||||
key=lambda x: x.split('.')[1:]
|
||||
)
|
||||
|
||||
logfile = join(logdir, logfiles[-1])
|
||||
|
||||
|
||||
Reference in new issue
Block a user