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

Re: svn commit: rev 1985 - trunk/subversion/libsvn_client trunk/subversion/mod_dav_svn trunk/subversion/libsvn_ra_dav

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-05-21 02:41:38 CEST

On Mon, May 20, 2002 at 06:47:30PM -0500, sussman@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_ra_dav/fetch.c Mon May 20 18:47:30 2002
>...
> + /* if we're within a <resource> tag, then just call the generic
> + RA set_wcprop_callback directly; no need to use the
> + update-editor. */
> + if ((rb->current_wcprop_path != NULL)
> + && rb->ras->callbacks->set_wc_prop)
> + {
> + svn_string_t *href_val = svn_string_create(rb->href->data,
> + rb->ras->pool);

This makes a useless copy of the value. The code will be faster and less
resource intensive if you simply do:

    svn_string_t href_val;
    
    href_val.data = rb->href->data;
    href_val.len = rb->href->len;
    ...
      ... set_wc_prop(..., &href_val, ...)

Heck, since you have a stringbuf, you've already got the length (whereas the
call to svn_string_create() was going to recompute the length; at least
something like svn_string_create_from_buf() would have avoided that)

>...
> + CHKERR( rb->ras->callbacks->set_wc_prop(rb->ras->callback_baton,
> + rb->current_wcprop_path,
> + rb->vuh.name->data,

The rb->vuh.name->data should be replaced with: SVN_RA_DAV__LP_VSN_URL

(the need to keep 'vuh' around is an artifact of the old editor interface;
 as we migrate to the new interface, we'll be tossing it. set_wc_prop
 already uses a sane interface, so 'vuh.name' isn't needed there)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 21 02:39:31 2002

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.