Skip to content

Commit

Permalink
refactor(progress): simplify count of counts definition
Browse files Browse the repository at this point in the history
Signed-off-by: David Wallace <[email protected]>
  • Loading branch information
MyPyDavid committed Aug 8, 2024
1 parent aa2846a commit 514a43f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rdmo/projects/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def compute_navigation(section, project, snapshot=None):
counts = count_questions(page, sets, conditions)

# filter the values_list for the attributes, and compute the total sum of counts
count = len(tuple(filter(lambda value: value[0] in counts.keys(), values_list)))
count = sum(1 for value in values_list if value[0] in counts)
total = sum(counts.values())

navigation_section['count'] += count
Expand Down Expand Up @@ -130,7 +130,7 @@ def compute_progress(project, snapshot=None):
counts = count_questions(project.catalog, sets, conditions)

# filter the values_list for the attributes, and compute the total sum of counts
count = len(tuple(filter(lambda value: value[0] in counts.keys(), values_list)))
count = sum(1 for value in values_list if value[0] in counts)
total = sum(counts.values())

return count, total
Expand Down

0 comments on commit 514a43f

Please sign in to comment.