Skip to content

Commit

Permalink
Optimize common use patterns.
Browse files Browse the repository at this point in the history
Most calls to stats-job are for a job currently reserved by the
caller, so check that first before doing a (slow) sequential scan
through the lists of ready and delayed jobs.
  • Loading branch information
Keith Rarick committed Mar 27, 2008
1 parent 64c6241 commit 75964e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ peek_ready_job(unsigned long long int id)
static job
peek_job(unsigned long long int id)
{
return peek_ready_job(id) ? :
return find_reserved_job(id) ? :
peek_ready_job(id) ? :
pq_find(&delay_q, id) ? :
find_reserved_job(id) ? :
find_buried_job(id);
}

Expand Down

0 comments on commit 75964e9

Please sign in to comment.