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

Re: svn commit: r28658 - in trunk/subversion: include libsvn_ra_neon libsvn_ra_serf libsvn_subr libsvn_wc

From: Branko Čibej <brane_at_xbc.nu>
Date: 2007-12-28 01:39:34 CET

Peter Samuelson wrote:
> [brane@tigris.org]
>
>> +int
>> +svn_ctype_casecmp(int a, int b)
>> +{
>> + const int A = casefold_table[(unsigned char)a];
>> + const int B = casefold_table[(unsigned char)b];
>> + if (A && B)
>> + return (A - B);
>> + else
>> + return (a - b);
>> +}
>>
>
> No need for the conditional - the following is simpler and faster.
>
Quite likely, yes -- except that you'd probably see signed-char
inconsistencies if you change the types involved the way you did. I'd
keep A and B as int (no performance hit there) and casefold_table as
unsigned char (no weirdness there).

Please, make the change. :) And I'd be happier if genctype.py was still
used to generate the tables.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 28 01:39:51 2007

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.