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

Re: [PATCH] Repository root relative url support in svn CLI -- REDUX

From: Troy Curtis Jr <troycurtisjr_at_gmail.com>
Date: Sun, 17 Feb 2008 08:43:57 -0600

On Feb 17, 2008 7:52 AM, Branko ibej <brane_at_xbc.nu> wrote:
> Troy Curtis Jr wrote:
> > +svn_boolean_t
> > +svn_path_is_relative_url(const char *url)
> > +{
> > + return(0 == strncmp("^/", url, 2) ? TRUE : FALSE);
> > +}
> =-O
> I find this to be most inelegant.
> return !strncmp("^/", url, 2);
> -- Brane

Yeah but that is not the right return type now is it? And the return
type was chosen based on precedence (svn_path_is_url()).

But even without that I am a big believer in being explicit for
readability. You look at my line of code and you don't have to pause
and make sure you have your inversions right, it is plainly obviously
what it is doing. Of course there are a LOT more characters doing it
my way, and that does bother some people. :)

Of course even in my line the "0 ==" could be considered extraneous, I
could leave it off and flip the TRUE and FALSE. But this way I really
think it makes it much easier to see what the intention of the code

To each his own right?


"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)
Received on 2008-02-17 15:44:11 CET

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.