[Top][All Lists]

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

Re: [PATCH] add new module filevercmp

From: Jim Meyering
Subject: Re: [PATCH] add new module filevercmp
Date: Fri, 26 Sep 2008 13:26:09 +0200

Kamil Dudka <address@hidden> wrote:
> On Wednesday 24 September 2008 22:52:00 Jim Meyering wrote:

...  if (!strcmp (s1, s2))

>> > +  int rc = verrevcmp (s1, s1_len, s2, s2_len);
>> > +  return (rc == 0)
>> > +    /* return 0 if (and only if) strings S1 and S2 are identical */
>> > +    ? strcmp(s1, s2) : rc;
>> strcmp(s1, s2) is always nonzero here, since
>> it was tested at the beginning of the function.
> That's true, but I don't think here is a problem. Please consider new function
> description:

But calling strcmp a second time with identical
arguments is unnecessary and probably wasteful.
Or perhaps you verified that gcc's optimization is good
enough to identify and eliminate this duplication?

If you leave the latter strcmp, add a space before its opening
parenthesis.  That this spacing issue remains suggests you
haven't checked everything with GNU indent.  Please do that.

I'll look at the rest later today.

reply via email to

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