From 51d485e236586661771f0469ccf1598e3f80ae70 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 20 Aug 2012 12:31:43 +1000 Subject: [PATCH] No need for extra variable in hash_push. --- cgminer.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cgminer.c b/cgminer.c index 9582dd9f..31bd4df9 100644 --- a/cgminer.c +++ b/cgminer.c @@ -2882,12 +2882,7 @@ static bool work_rollable(struct work *work) static bool hash_push(struct work *work) { - bool rc = true, dec = false; - - if (work->queued) { - work->queued = false; - dec = true; - } + bool rc = true; mutex_lock(stgd_lock); if (work_rollable(work)) @@ -2900,8 +2895,10 @@ static bool hash_push(struct work *work) pthread_cond_signal(&getq->cond); mutex_unlock(stgd_lock); - if (dec) + if (work->queued) { + work->queued = false; dec_queued(); + } return rc; }