Skip to content

Commit 293dea4

Browse files
committed
job-list: clarify comment
Problem: There is a comment describing job list filtering with the 'since' filtering. The comment is a little confusing because it does not match the code, doesn't describe how a list is sorted, and happens to use the word "since" in the description, which can be confusing. Clarify the comment with more details.
1 parent 7716abc commit 293dea4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/modules/job-list/list.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ int get_jobs_from_list (json_t *jobs,
7979
job = zlistx_first (list);
8080
while (job) {
8181

82-
/* If job->t_inactive > 0. (we're on the inactive jobs list),
83-
* and job->t_inactive > since, then we're done since inactive
84-
* jobs are sorted by inactive time.
82+
/* If job->t_inactive > 0. we're on the inactive jobs list and jobs are
83+
* sorted on the inactive list, larger t_inactive first.
84+
*
85+
* If job->t_inactive > since, this is a job that could potentially be returned
86+
*
87+
* So if job->t_inactive <= since, then we're done b/c the rest of the inactive
88+
* jobs cannot be returned.
8589
*/
8690
if (job->t_inactive > 0. && job->t_inactive <= since)
8791
break;

0 commit comments

Comments
 (0)