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

Re: A do-nothing loop?

From: <kfogel_at_collab.net>
Date: 2003-10-10 20:09:05 CEST

Julian Foad <julianfoad@btopenworld.com> writes:
> It looks like the "for" loop in this code is just wasting time. Am I right?

It could conceivably be moving things from one pool to another... But
no, I don't think it is, or isn't doing it correctly, if that's its
intention. And, depending on the allocation promises of
ra_lib->rev_proplist, such a transfer may not even be necessary!

Weird. What happens if you yank the loop?

-K

> subversion/libsvn_client/prop_commands.c:
>
> svn_error_t *
> svn_client_revprop_list (apr_hash_t **props,
> const char *URL,
> const svn_opt_revision_t *revision,
> svn_revnum_t *set_rev,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> void *ra_baton, *session;
> svn_ra_plugin_t *ra_lib;
> apr_hash_t *proplist;
> apr_hash_index_t *hi;
>
> [...]
>
> /* The actual RA call. */
> SVN_ERR (ra_lib->rev_proplist (session, *set_rev, &proplist, pool));
>
> for (hi = apr_hash_first (pool, proplist); hi; hi = apr_hash_next (hi))
> {
> const void *key;
> void *val;
> apr_ssize_t klen;
>
> apr_hash_this (hi, &key, &klen, &val);
> apr_hash_set (proplist, key, klen, val);
> }
>
> *props = proplist;
> return SVN_NO_ERROR;
> }
>
> - Julian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 10 20:44:54 2003

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.