Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash table: use lookup instead of iteration #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions cgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down