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

Re: [PATCH + RFC]: Fixed length keywords

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-10-16 06:54:42 CEST

I have a nitpick:

+ if (! value)
[...]
+ else if (value && (max_value_len > 0))
[...]
+ else
+ {
+ /* if we are here, we have a logic error in the code */
+ assert(1 == 0);
+ }

This is silly for a variety of reasons:

  * No space before the open paren.
  * assert (0) would be more concise.
  * Replacing the "else if (...) { ... }" with "else { assert
(max_value_len > 0); ... } would be more straightforward.
  * Replacing the "else if (...) { ... }" with just "else { ... }" and
ditching the assertion altogether would be fine, since your effective
assertion is just mirroring the "(6 + keyword_len < *len)" clause in the
outer if block, since max_value_len is *len - (6 + keyword_len)".

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 16 06:55:11 2004

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.