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