diff --git a/cgminer.c b/cgminer.c index d1aca0f51b..4076e0dc94 100644 --- a/cgminer.c +++ b/cgminer.c @@ -8121,17 +8121,10 @@ struct work *clone_queued_work_bymidstate(struct cgpu_info *cgpu, char *midstate * given que hashtable. Code using this function must be able * to handle NULL as a return which implies there is no matching work. * The calling function must lock access to the que if it is required. */ -struct work *__find_work_byid(struct work *que, uint32_t id) +struct work *__find_work_byid(struct work *queue, uint32_t id) { - struct work *work, *tmp, *ret = NULL; - - HASH_ITER(hh, que, work, tmp) { - if (work->id == id) { - ret = work; - break; - } - } - + struct work *ret = NULL; + HASH_FIND_INT(queue, &id, ret); return ret; }