bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: STREQ in dfa.c


From: Aharon Robbins
Subject: Re: STREQ in dfa.c
Date: Sat, 31 Dec 2011 20:26:04 +0200
User-agent: Heirloom mailx 12.4 7/29/08

Hi.

> From: Jim Meyering <address@hidden>
> To: address@hidden
> Cc: address@hidden
> Subject: Re: STREQ in dfa.c
> Date: Sat, 31 Dec 2011 18:48:15 +0100
>
> address@hidden wrote:
>
> > There are not a lot of uses of STREQ in dfa.c. I'd be happy if you
> > expanded the macro there.
>
> Sorry, but that would be a step backwards.
> I find that direct use of strcmp is markedly less readable
> when the result is used as a boolean.

Interesting. I'd rather read

        strcmp(x, y) == 0
and
        strcmp(x, y) != 0

I am violently opposed to

        ! strcmp(x, y)

This moves into the realm of individual tastes...

> > Gawk's STREQ checks  *a == *b before calling
> > strcmp, which is an OOOOLLLLDDDD speed hack from the PDP-11 / Vax
> > days. I should probably get rid of it.
>
> Good idea.

If I do I will just go to using straight calls to strcmp/strncmp,
but per your email, I won't mess with dfa.c.  Some of the gawk code
already has direct calls to strcmp so I may as well make things
consistent.

Thanks,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]