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

Re: svn commit: r932635 - /subversion/trunk/subversion/libsvn_repos/reporter.c

From: Blair Zajac <blair_at_orcaware.com>
Date: Fri, 09 Apr 2010 16:34:01 -0700

On 04/09/2010 03:33 PM, Stefan Sperling wrote:
> On Fri, Apr 09, 2010 at 03:15:21PM -0700, Blair Zajac wrote:
>> On 04/09/2010 03:08 PM, stsp_at_apache.org wrote:
>>> Author: stsp
>>> Date: Fri Apr 9 22:08:40 2010
>>> New Revision: 932635
>>>
>>> URL: http://svn.apache.org/viewvc?rev=932635&view=rev
>>> Log:
>>> * subversion/libsvn_repos/reporter.c
>>> (update_entry): Style nit: Replace "if (a) b = TRUE;" with "b = (a);"
>>
>>> - else if (distance != -1 || b->ignore_ancestry)
>>> - related = TRUE;
>>> +
>>> + related = (distance != -1 || b->ignore_ancestry);
>>
>> Why not then also remove the related = FALSE just above this code as
>> it's redundant.
>
> Because the assignment happens inside an if-statement.
> If we don't enter the if-statement, 'related' may end
> up being uninitialised.
>
> Here's the full context:
>
> related = FALSE;
> if (s_entry&& t_entry&& s_entry->kind == t_entry->kind)
> {
> distance = svn_fs_compare_ids(s_entry->id, t_entry->id);
> if (distance == 0&& !any_path_info(b, e_path)
> && (!info || (!info->start_empty&& !info->lock_token))
> && (requested_depth<= wc_depth || t_entry->kind == svn_node_file))
> return SVN_NO_ERROR;
>
> related = (distance != -1 || b->ignore_ancestry);
> }

Oh right, too quick on the review :)

Blair
Received on 2010-04-10 01:34:31 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.