Peter Samuelson <pe...@p12n.org> writes:

> [Stefan Fuhrmann]
>> --- subversion/libsvn_subr/checksum.c        (revision 937673)
>> +++ subversion/libsvn_subr/checksum.c        (working copy)
>> @@ -206,12 +206,39 @@
>>  
>>    for (i = 0; i < len; i++)
>>      {
>> -      if ((! isxdigit(hex[i * 2])) || (! isxdigit(hex[i * 2 + 1])))
>> +      char c1 = hex[i * 2];
>> +      char c2 = hex[i * 2 + 1];
>
> Hmmmm.  On the one hand, your open-coding of isxdigit will be less
> efficient than the original, which uses a table lookup.  On the other
> hand, replacing isalpha is probably for the best, since isalpha is
> locale-sensitive.

We have svn_ctype_isalpha which is a macro that does a table lookup.
We don't currently have svn_ctype_isxdigit but it could be added.

> I'd rather see the whole thing become a single table lookup.  Untested
> patch appended.

Is this a bottleneck?  I think using the svn_ctype.h macros should be
sufficient.

-- 
Philip

Reply via email to