Optimize and simplify svn_checksum_parse_hex(). In my tests, the new version is 20% to 30% faster. The EBCDIC port would probably need an…
Optimize and simplify svn_checksum_parse_hex(). In my tests, the newversion is 20% to 30% faster. The EBCDIC port would probably need an#ifdef here.Also happens to fix the case of input with uppercase A-F characters.We neither parsed them correctly nor rejected them as invalid.Now we accept _and_ parse them correctly.* subversion/libsvn_subr/checksum.c (svn_checksum_parse_hex): Rewrite to do a single table lookup to find the validity and value of a hex byte, rather than two lookups (svn_ctype_isxdigit, svn_ctype_isalpha) plus some ASCII math. Also, don't bother to qualify char as unsigned except where actually needed, and rename is_zeros to is_nonzero to match its meaning.