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

Re: svn commit: r1484260 - /subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_client/diff.c

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 20 May 2013 17:50:05 +0100

Gabriela Gibson <gabriela.gibson_at_gmail.com> writes:

>>> if (config)
>>> {
>>> - svn_config_t *cfg = svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG);
>>> + svn_config_t *cfg;
>>> +
>>> + cfg = svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG);
>>
>> Why? This doesn't seem to serve any useful purpose (in fact, I think it makes
>> the code harder to read).
>>
>
> Because (if I understood this correctly!) the compiler builds more efficient code and the startup time of the application is improved.
>
> "To summarize, it is always preferable to add variables
> as uninitialized or initialized with zero as opposed to as
> initialized with a value other than zero."
>
> See Page 16 here:
> http://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf

The quote is referring to static variables, it doesn't apply to stack
variables.

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2013-05-20 18:50:39 CEST

This is an archived mail posted to the Subversion Dev mailing list.