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

Re: svn commit: r33043 - trunk/subversion/libsvn_client

From: Philip Martin <philip_at_codematters.co.uk>
Date: Sat, 13 Sep 2008 17:35:17 +0100

hwright_at_tigris.org writes:

> Author: hwright
> Date: Fri Sep 12 12:10:13 2008
> New Revision: 33043
>
> Log:
> Directly return some errors, removing superfluous invocations of SVN_ERR().
> This only handles libsvn_client; the other libraries could be similarly
> audited.
>
> I tried not to be too agressive when doing this. There's a balance between
> maintainability and efficiency: there are probably other places where we can
> directly return, but tracking those down is tricky, and can introduce subtle
> bugs for future maintainers.

Looks like pointless code churn to me; every active branch is now
facing a massive merge. What is the gain?

> @@ -1939,26 +1922,23 @@ setup_copy(svn_commit_info_t **commit_in
> if ((! srcs_are_urls) && (! dst_is_url))
> {
> *commit_info_p = NULL;
> - SVN_ERR(wc_to_wc_copy(copy_pairs, is_move, make_parents,
> - ctx, pool));
> + return wc_to_wc_copy(copy_pairs, is_move, make_parents, ctx, pool);
> }
> else if ((! srcs_are_urls) && (dst_is_url))
> {
> - SVN_ERR(wc_to_repos_copy(commit_info_p, copy_pairs, make_parents,
> - revprop_table, ctx, pool));
> + return wc_to_repos_copy(commit_info_p, copy_pairs, make_parents,
> + revprop_table, ctx, pool);
> }
> else if ((srcs_are_urls) && (! dst_is_url))
> {
> *commit_info_p = NULL;
> - SVN_ERR(repos_to_wc_copy(copy_pairs, make_parents, ctx, pool));
> + return repos_to_wc_copy(copy_pairs, make_parents, ctx, pool);
> }
> else
> {
> - SVN_ERR(repos_to_repos_copy(commit_info_p, copy_pairs, make_parents,
> - revprop_table, ctx, is_move, pool));
> + return repos_to_repos_copy(commit_info_p, copy_pairs, make_parents,
> + revprop_table, ctx, is_move, pool);
> }
> -
> - return SVN_NO_ERROR;
> }

It might be an improvement in short functions, but in cases like the
code above it's not clear that your new code is better--if pushed I
probably prefer the original code.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-13 18:35:34 CEST

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