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

Re: svn commit: rev 3912 - in trunk/subversion: libsvn_subr tests/libsvn_subr

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2002-11-26 21:20:27 CET

cmpilato@tigris.org writes:
...
> +static svn_boolean_t
> +char_is_uri_safe (int c)
> +{
> + /* Is this an alphanumeric character? */
> + if (((c >= 'A') && (c <='Z'))
> + || ((c >= 'a') && (c <='z'))
> + || ((c >= '0') && (c <='9')))
> + return TRUE;
> +
> + /* Is this a supported non-alphanumeric character? (these are sorted
> + by estimated usage, most-to-least commonly used) */
> + if (strchr ("/:.-_!~'()@=+$,&*", c) != NULL)
> + return TRUE;
> +
> + return FALSE;
> +}
...

Not positive what the SVN style is, but I generally just return
directly:

  return (strchr ("/:.-_!~'()@=+$,&*", c) != NULL);

Compresses 3 statements into 1 and is still very readable.

-- 
Daniel Rall <dlr@finemaltcoding.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 26 21:21:03 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.