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

Re: svn commit: r1431017 - in /subversion/trunk: subversion/libsvn_delta/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/ subversion/libsvn_ra_svn/ subversion/libsvn_repos/ subversion/libsvn_subr/ subversion/svn/ subversion/s...

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 9 Jan 2013 19:36:11 +0000 (GMT)

Stefan,

 > Log:

> Coding style patch: in logical expressions, instead of comparing
> with logical constants use arithmetic operations. I.e. replace

No don't use arithmetic operations.  Maybe write, "In *boolean* expressions, instead of comparing with FALSE (or, worse, with TRUE), use *boolean* operators."

> Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
> +++ subversion/trunk/subversion/libsvn_ra_svn/client.c Wed Jan  9 19:24:52 2013
> @@ -1304,9 +1304,9 @@ static svn_error_t *ra_svn_get_dir(svn_r
> static svn_tristate_t
> optbool_to_tristate(apr_uint64_t v)
> {
> -  if (v == TRUE)
> +  if (v)

No, no, not here!

>     return svn_tristate_true;
> -  if (v == FALSE)
> +  if (!v)
>     return svn_tristate_false;
>
>   return svn_tristate_unknown; /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */

Everything else looks correct.

- Julian
Received on 2013-01-09 20:43:27 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.