Skip to content

Commit

Permalink
Use the memoized reserver for has_reserved_this_job.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Jun 12, 2008
1 parent 8e91b54 commit 261845d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,9 @@ soonest_job(conn c)
}

int
has_reserved_this_job(conn c, job needle)
has_reserved_this_job(conn c, job j)
{
job j;

for (j = c->reserved_jobs.next; j != &c->reserved_jobs; j = j->next) {
if (needle == j) return 1;
}
return 0;
return j && j->state == JOB_STATE_RESERVED && j->reserver == c;
}

/* return true if c has a reserved job with less than one second until its
Expand Down

0 comments on commit 261845d

Please sign in to comment.