[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH]: tentative fix for libsvn_ra_dav request_auth-bug (issue 1005)

From: Blair Zajac <blair_at_orcaware.com>
Date: 2002-11-22 21:44:30 CET

Marcus Comstedt wrote:
>
> cmpilato@collab.net writes:
>
> > I *refuse* to apply this patch...because ***I just wrote almost the
> > exact same code myself!***
> >
> > :-)
> >
> > I mean, the only difference I can see is that you use:
> >
> > if (foo == NULL)
> >
> > and I use:
> >
> > if (! foo)
> >
> > Wow.
>
> Hehe. Well, yeah, it was mostly a no-brainer. Not too many ways to
> do it really.
>
> The reason I opted for (foo == NULL) over (! foo) was that NULL in
> this case is a kind of "magic value", so it made sense to compare
> against it explicitly to better show what was going on. It doesn't
> matter much either way.

Just as an FYI, a lot of developers I work with like to use

(NULL == foo)

instead, that way if you forget one '=' then the code becomes a compile
error instead of an assignment of NULL to foo. I'm well aware that gcc
warns you about this kind of assignment in a if (), but it's still a
good practice that I use.

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 22 21:44:58 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.