Remove unnecessary amount of pathclass.Path instantiation.
This commit is contained in:
parent
c87d38a36b
commit
f4d3679063
1 changed files with 5 additions and 5 deletions
|
@ -176,11 +176,11 @@ class TSDB:
|
||||||
for, and return that path. If none of them exist, then use the most
|
for, and return that path. If none of them exist, then use the most
|
||||||
preferred filepath.
|
preferred filepath.
|
||||||
'''
|
'''
|
||||||
paths = [pathclass.Path(format.format(name=name)) for format in formats]
|
for form in formats:
|
||||||
for path in paths:
|
path = form.format(name=name)
|
||||||
if path.is_file:
|
if os.path.isfile(path):
|
||||||
return path
|
break
|
||||||
return paths[-1]
|
return pathclass.Path(path)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def for_subreddit(cls, name, do_create=True):
|
def for_subreddit(cls, name, do_create=True):
|
||||||
|
|
Loading…
Reference in a new issue