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

Re: svn commit: r37868 - trunk/subversion/libsvn_subr

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 7 Jul 2009 14:47:52 +0200

On Wed, May 27, 2009 at 22:48, Hyrum K. Wright<hyrum_at_hyrumwright.org> wrote:
> On May 27, 2009, at 3:17 PM, Paul T. Burba wrote:
>...
>> +  svn_pool_destroy(iterpool);
>> +  return err;
>
> Not a big deal, but the above should be:
> return svn_error_return(err)
>
> This ensures we get proper debug tracing even when directly returning
> errors.

In this case, just saying "return err;" is fine. Consider that "err"
is created within this function, with "good" file/line values. There
is no additional tracing needed.

(and yes, I know it was later removed; point is that "return
svn_error_return(err);" is not *always* proper)

>...

And if this function is trying to be smarter about efficiency, pool
usage, etc, then it should avoid svn_string_ncreate() and its
alloc/copy. It can alloc the buffer in the result pool, and manually
alloc/assemble an svn_string_t in the result pool using that buffer.

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2368804
Received on 2009-07-07 14:48:13 CEST

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.