PATCH: mount -O list
Michael Abbott
michael at araneidae.co.uk
Fri Dec 4 13:06:00 UTC 2009
On Fri, 4 Dec 2009, Denys Vlasenko wrote:
> On Fri, Dec 4, 2009 at 1:48 PM, Michael Abbott <michael at araneidae.co.uk> wrote:
> > On Fri, 4 Dec 2009, walter harms wrote:
> >> Michael Abbott schrieb:
> >> > 3. strchrnul() -- oh, that is nice! Is that a busybox special function?
> >> > It doesn't seem to be part of glibc. Of course, makes the step on to the
> >> > next item at the end of the loop slightly more clunky.
> On the contrary, it makes the step smaller. I checked code size.
Intruiging.
I was only referring to the difference between
if (!O_comma)
break;
and
if (O_opt[O_len] == '\0')
break;
and now think I was talking nonsense, each is as clear as each other. Of
course the first is (potentially) just a register access, while the second
definitely fetches ram (already seen, so probably in cache), so there is
some difference.
Of course
O_len = strchrnul(O_opt, ',') - O_opt;
is going to take up less code (and is *much* clearer) than
O_comma = strchr(O_opt, ',');
O_len = O_comma ? O_comma - O_opt : strlen(O_opt);
which I presume is where most of the code size difference you checked came
from.
But actually I'm completely persuaded: I'll use strchrnul() next time I do
some parsing.
More information about the busybox
mailing list