From aa0086079f10db1227abac029533d30d3601f27d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 26 Jan 2015 11:15:57 +1100 Subject: [PATCH] Use HASH_ITER in update_diff for clarity --- src/stratifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index ad42e193..65849de0 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1058,7 +1058,7 @@ static void stratum_send_diff(sdata_t *sdata, stratum_instance_t *client); static void update_diff(ckpool_t *ckp) { - stratum_instance_t *client; + stratum_instance_t *client, *tmp; sdata_t *sdata = ckp->data; double old_diff, diff; json_t *val; @@ -1097,7 +1097,7 @@ static void update_diff(ckpool_t *ckp) /* If the diff has dropped, iterate over all the clients and check * they're at or below the new diff, and update it if not. */ ck_rlock(&sdata->instance_lock); - for (client = sdata->stratum_instances; client != NULL; client = client->hh.next) { + HASH_ITER(hh, sdata->stratum_instances, client, tmp) { if (client->diff > diff) { client->diff = diff; stratum_send_diff(sdata, client);