From 2d15fa07e7eb853266d5e723ff67fcb3894c66e8 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Mon, 12 Nov 2018 14:27:30 +0100 Subject: [PATCH] Simplify some code --- src/opencl.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/opencl.c b/src/opencl.c index 97b624f21..91794e000 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2794,9 +2794,10 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co total_msec += device_param->speed_msec[speed_pos]; } - if (user_options->slow_candidates == true) + if ((total_msec > 4000) || (device_param->speed_pos == SPEED_CACHE - 1)) { - if ((total_msec > 4000) || (device_param->speed_pos == SPEED_CACHE - 1)) + + if (user_options->slow_candidates == true) { const u32 speed_pos = device_param->speed_pos; @@ -2805,24 +2806,13 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co device_param->speed_cnt[0] = device_param->speed_cnt[speed_pos - 1]; device_param->speed_msec[0] = device_param->speed_msec[speed_pos - 1]; } - - device_param->speed_pos = 1; - - device_param->speed_only_finish = true; - - break; } - } - else - { - // it's unclear if 4s is enough to turn on boost mode for all opencl device - if ((total_msec > 4000) || (device_param->speed_pos == SPEED_CACHE - 1)) - { - device_param->speed_only_finish = true; + device_param->speed_pos = 1; - break; - } + device_param->speed_only_finish = true; + + break; } } }