Skip to content

Commit

Permalink
Remove unecessary iter() from WorkqueueService.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderrichards committed Feb 12, 2020
1 parent 3409c9e commit dfdef6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pdm/workqueue/WorkqueueService.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def return_output(job_id, element_id):
and element.type == JobType.LIST\
and element.status == JobStatus.DONE:
element_counter = 0
element_listing = sorted(iter(element.listing.items()), key=lambda item: len(item[0]))
element_listing = sorted(element.listing.items(), key=lambda item: len(item[0]))
dir_copy = False
if element_listing and \
element_listing[0][0].rstrip('/') == job.src_filepath.rstrip('/'):
Expand All @@ -270,7 +270,7 @@ def return_output(job_id, element_id):
and element.type == JobType.LIST\
and element.status == JobStatus.DONE:
element_counter = 0
for root, listing in sorted(iter(element.listing.items()),
for root, listing in sorted(element.listing.items(),
key=lambda item: len(item[0]), reverse=True):
for entry in sorted(listing, key=lambda x: stat.S_ISDIR(int(x['st_mode']))):
element_counter += 1
Expand Down

0 comments on commit dfdef6c

Please sign in to comment.