apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucian Adrian Grijincu" <lucian.griji...@gmail.com>
Subject Re: some simplifications for the Netware apr_thread_create code
Date Sun, 14 Oct 2007 12:42:34 GMT
On 10/14/07, Lucian Adrian Grijincu <lucian.grijincu@gmail.com> wrote:
> On 10/14/07, William A. Rowe, Jr. <wrowe@rowe-clan.net> wrote:
> > Lucian Adrian Grijincu wrote:
> > > Just removing some unused code.
> > > APR_SUCCESS is deemed to be zero as I understand it, so no use in
> > > checking for it explicitly.
> >
> > Untrue, because it makes things clearer to the reader.
> >
>

and I find things like:
    x = smth();
    x = smth_else();
    use(x);

more confusing than
    smth();
    x = smth_else();
    use(x);

Even though then compiler might optimize away the first attribution.


> isn't this why they invented comments?
>
> why do:
>
>    if(x==0)
>      return 0;
>    return x;
>
> when you can do:
>    return x; //and place a witty comment here?
>
> saves a cmp and a jump.
>
> > The compiler can't care less if you compare (rv == 0) or (!rv),
> > it optimizes it the same way.
> >
>
> What !rv? i don't wanna do the comparison at all.
>

--
Lucian

Mime
View raw message