in apr-conv10-faster.patch you added:

static const char digits[] = "0123456789";
*--p = digits[magnitude % 10];

Why is this faster than:
*--p = (char) '0' + (magnitude % 10); ?

For your "faster" version, under the hood, the C compiler adds
(magnitude % 10) to the address of digits and then copies the contents
of the memory location represented by the sum's result into *--p.

My version just adds (magnitude % 10) to '0' and stores the result in *--p.

Am I missing something here?

--
Lucian Adrian Grijincu

On 4/27/07, Davi Arnaut <[EMAIL PROTECTED]> wrote:
Hi,

A few cleanups for the vformatter code. Each patch has a description.

--
Davi Arnaut


Reply via email to