On Wed, Apr 13, 2011 at 15:07, Bert Huijben <[email protected]> wrote: > > >> -----Original Message----- >> From: Greg Stein [mailto:[email protected]] >> Sent: woensdag 13 april 2011 20:30 >> To: [email protected] >> Subject: Re: svn commit: r1091728 - in /subversion/trunk/subversion: >> include/private/svn_wc_private.h libsvn_client/commit_util.c libsvn_wc/wc- >> queries.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h >> >> On Wed, Apr 13, 2011 at 06:17, <[email protected]> wrote: >> >... >> > +++ subversion/trunk/subversion/libsvn_client/commit_util.c Wed Apr 13 >> 10:17:21 2011 >> > @@ -661,29 +661,24 @@ harvest_committables(svn_wc_context_t *w >> > { >> > apr_hash_t *local_relpath_tokens; >> > apr_hash_index_t *hi; >> > + apr_pool_t *token_pool = apr_hash_pool_get(lock_tokens); >> > >> > SVN_ERR(svn_wc__node_get_lock_tokens_recursive( >> > &local_relpath_tokens, wc_ctx, local_abspath, >> > - scratch_pool, scratch_pool)); >> > + token_pool, scratch_pool)); >> > >> > - /* Map local_relpaths to URLs. */ >> > + /* Add tokens to existing hash. */ >> > for (hi = apr_hash_first(scratch_pool, local_relpath_tokens); >> > hi; >> > hi = apr_hash_next(hi)) >> >> This loop can be removed in favor of apr_hash_overlay(). > > /** > * Merge two hash tables into one new hash table. The values of the overlay > * hash override the values of the base if both have the same key. Both > * hash tables must use the same hash function. > * @param p The pool to use for the new hash table > * @param overlay The table to add to the initial table > * @param base The table that represents the initial values of the new table > * @return A new hash table containing all of the data from the two passed > in > */ > APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, > const apr_hash_t *overlay, > const apr_hash_t *base); > > This function returns a new apr_hash_t *, while the caller of this function > expects us to update the existing hashtable.
Ah! Good point. Thanks!

