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

RE: iteration pools and 'continue'

From: Sander Striker <striker_at_apache.org>
Date: 2003-05-13 21:29:08 CEST

> From: Sander Striker [mailto:striker@apache.org]
> Sent: Tuesday, May 13, 2003 9:22 PM

Mumbling to self:

[...]
> Changing that to a for loop would fix the problem:
>
> subpool = svn_pool_create(pool);
>
> for (; condition; svn_pool_clear(subpool))
> {
> ...
>
> if (some_other_condition)
> continue;
>
> ...
> }
>
> svn_pool_destroy(subpool);

Actually you don't want to do this. The destroy already
ensures the clear. It is less efficient than doing:

while (condition)
  {
    svn_pool_clear(subpool);

    ...
  }

svn_pool_destroy(subpool);

This is due internal locking in the pools implementation,
for those who care.

Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 13 21:30:05 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.