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

Re: svn commit: r1327695 - /subversion/trunk/subversion/libsvn_subr/checksum.c

From: Blair Zajac <blair_at_orcaware.com>
Date: Wed, 18 Apr 2012 15:39:03 -0700

On 04/18/2012 02:57 PM, Greg Stein wrote:
> On Wed, Apr 18, 2012 at 17:52,<blair_at_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
Received on 2012-04-19 00:39:40 CEST

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.