From: Herwin Weststrate Date: Fri, 17 Oct 2014 17:34:52 +0000 (+0200) Subject: Use *= 2 instead of += $self for doubling X-Git-Tag: release_3_0_5~298 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=a116a1e19f69798bacde790b6bee324d9eb6998c;p=freeradius.git Use *= 2 instead of += $self for doubling The generated code is slightly more efficient too (unless you consider compiler optimizations) This fixes the following message of cppcheck: [src/modules/rlm_unbound/rlm_unbound.c:157]: (style) Same expression on both sides of '+='. --- diff --git a/src/modules/rlm_unbound/rlm_unbound.c b/src/modules/rlm_unbound/rlm_unbound.c index 927d1b8..cadc6d3 100644 --- a/src/modules/rlm_unbound/rlm_unbound.c +++ b/src/modules/rlm_unbound/rlm_unbound.c @@ -154,7 +154,7 @@ static int ub_common_wait(rlm_unbound_t *inst, REQUEST *request, char const *tag iv = inst->timeout > 64 ? 64000 : inst->timeout * 1000; ub_process(inst->ub); - for (waited = 0; (void*)*ub == (void *)inst; waited += iv, iv += iv) { + for (waited = 0; (void*)*ub == (void *)inst; waited += iv, iv *= 2) { if (waited + iv > (useconds_t)inst->timeout * 1000) { usleep(inst->timeout * 1000 - waited);