You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2011/04/20 10:41:27 UTC
svn commit: r1095322 - in /subversion/trunk/subversion:
libsvn_repos/rev_hunt.c libsvn_subr/mergeinfo.c
Author: philip
Date: Wed Apr 20 08:41:27 2011
New Revision: 1095322
URL: http://svn.apache.org/viewvc?rev=1095322&view=rev
Log:
Move a recent optimisation from the caller to the called function so
that all other callers benefit.
* subversion/libsvn_subr/mergeinfo.c
(svn_mergeinfo_merge): Early return if no changes.
* subversion/libsvn_repos/rev_hunt.c
(get_merged_mergeinfo): Remove empty hash check.
Modified:
subversion/trunk/subversion/libsvn_repos/rev_hunt.c
subversion/trunk/subversion/libsvn_subr/mergeinfo.c
Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/rev_hunt.c?rev=1095322&r1=1095321&r2=1095322&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Wed Apr 20 08:41:27 2011
@@ -1091,8 +1091,7 @@ get_merged_mergeinfo(apr_hash_t **merged
/* Then calculate and merge the differences. */
SVN_ERR(svn_mergeinfo_diff(&deleted, &changed, prev_mergeinfo, curr_mergeinfo,
FALSE, subpool));
- if (apr_hash_count(deleted))
- SVN_ERR(svn_mergeinfo_merge(changed, deleted, subpool));
+ SVN_ERR(svn_mergeinfo_merge(changed, deleted, subpool));
/* Store the result. */
if (apr_hash_count(changed))
Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mergeinfo.c?rev=1095322&r1=1095321&r2=1095322&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Wed Apr 20 08:41:27 2011
@@ -1296,6 +1296,9 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
apr_array_header_t *sorted1, *sorted2;
int i, j;
+ if (!apr_hash_count(changes))
+ return SVN_NO_ERROR;
+
sorted1 = svn_sort__hash(mergeinfo, svn_sort_compare_items_as_paths, pool);
sorted2 = svn_sort__hash(changes, svn_sort_compare_items_as_paths, pool);