Bruno Haible <[EMAIL PROTECTED]> writes:

> Simon Josefsson wrote:
>
>> +  l = dkLen / hLen;
>> +  if (dkLen % hLen)
>> +    l++;
>
> An equivalent but faster code is:
>
>      l = ((dkLen - 1) / hLen) + 1;

Perhaps for clarity we could change it into:

#define CEIL_DIV(a,b) (((a) - 1) / (b)) + 1
  l = CEIL_DIV (dkLen, hLen);

What do you think?

Neither of the first two approaches is really trivial to understand
what they mean, and a mnemonic like "CEIL_DIV" might improve
readability.

Thanks!


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to