You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2003/11/12 00:22:21 UTC
Re: svn commit: rev 7707 - branches/issue-1429-dev/subversion/mod_dav_svn
On Tue, Nov 11, 2003 at 05:58:02PM -0600, kfogel@tigris.org wrote:
>...
> +++ branches/issue-1429-dev/subversion/mod_dav_svn/update.c Tue Nov 11 17:58:01 2003
> @@ -719,10 +719,13 @@
> {
> if (value)
> {
> - const svn_string_t *qval = value;
> + const svn_string_t *qval;
>
> if (svn_xml_is_xml_safe(value->data, value->len))
> {
> + svn_stringbuf_t *tmp = NULL;
> + svn_xml_escape_cdata_string(&tmp, value, pool);
> + qval = svn_string_create (tmp->data, pool);
Urk. You're making another copy of that string, simply to transform it
into an svn_string_t structure. Icky. (ooh, and it gets worse...)
Ideally, qval would reside on the stack, and you could:
qval.data = tmp->data;
qval.len = tmp->len;
Obviously, that will change the other branch, but I imagine you can figure
out how to do that :-)
Hmm. Now that I pulled up the file to really look at the context, I'd
recommend changing qval to a 'const char *'. You can then do:
qval = tmp->data;
and in the other branch:
qval = svn_base64_encode_string(value, pool)->data;
Then just write out "qval" rather than "qval->data".
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
Re: svn commit: rev 7707 - branches/issue-1429-dev/subversion/mod_dav_svn
Posted by kf...@collab.net.
Greg Stein <gs...@lyra.org> writes:
> Urk. You're making another copy of that string, simply to transform it
> into an svn_string_t structure. Icky. (ooh, and it gets worse...)
>
> Ideally, qval would reside on the stack, and you could:
>
> qval.data = tmp->data;
> qval.len = tmp->len;
>
> Obviously, that will change the other branch, but I imagine you can figure
> out how to do that :-)
>
> Hmm. Now that I pulled up the file to really look at the context, I'd
> recommend changing qval to a 'const char *'. You can then do:
>
> qval = tmp->data;
>
> and in the other branch:
>
> qval = svn_base64_encode_string(value, pool)->data;
>
> Then just write out "qval" rather than "qval->data".
No one will ever notice a difference, but yeah, better karma. Thanks
for the review. *After* getting this branch working, I'll come back
and clean that up.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org