On 04/18/2012 02:57 PM, Greg Stein wrote:
On Wed, Apr 18, 2012 at 17:52,<bl...@apache.org>  wrote:
Author: blair
Date: Wed Apr 18 21:52:01 2012
New Revision: 1327695

URL: http://svn.apache.org/viewvc?rev=1327695&view=rev
Log:
Refactor svn_checksum_create() to avoid two switch statements.

* subversion/libsvn_subr/checksum.c
  (checksum_create):
    New static function that creates a svn_checksum_t * with
    everything set but the contents of the digest.
  (svn_checksum_create):
    Use the existing switch statement to get the digest size without
    needing DIGESTSIZE().  Use checksum_create().

Couldn't you just lose the switch in favor of: digest_size = DIGESTSIZE(kind) ??

That seemed micro-optimization wasteful, as it's checking the kind if it's a known checksum once and then checking it again on the size.

Blair

Reply via email to