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

Re: Redundant lines in do_entry_deletion()?

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Wed, 29 Oct 2008 09:03:48 -0400

Julian Foad wrote:
> Can anyone see whether the following marked lines are redundant? It
> looks to me like they are just re-setting the state of the existing
> entry.
>
> - Julian
>
> trunk/subversion/libsvn_wc/update_editor.c
>
>> @@ -1359,13 +1359,13 @@ do_entry_deletion(struct edit_baton *eb,
>>
>> tmp_entry.revision = *(eb->target_revision);
>> tmp_entry.kind =
>> - (entry->kind == svn_node_file) ? svn_node_file : svn_node_dir; /* ### redundant? */
>> tmp_entry.deleted = TRUE;
>>
>> SVN_ERR(svn_wc__loggy_entry_modify(&log_item, adm_access,
>> full_path, &tmp_entry,
>> SVN_WC__ENTRY_MODIFY_REVISION
>> - | SVN_WC__ENTRY_MODIFY_KIND /* ### redundant change? */
>> | SVN_WC__ENTRY_MODIFY_DELETED,
>> pool));
>>

Certainly looks redundant from where I sit. Does the history of this region
of code reveal anything interesting? Has the redundancy evolved into place,
or was it composed originally in this way? Is it significant that the first
of your marked lines doesn't just read:

    tmp_entry.kind = entry->kind;

? Is there another state that entry->kind could hold here besides
svn_node_file or svn_node_dir?

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-10-29 14:03:59 CET

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