[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:22:00 CEST

> From: Branko Cibej [mailto:brane@xbc.nu]
> Sent: Tuesday, May 13, 2003 9:16 PM

>> Anyone object to making this the suggested convention in HACKING?
>
> I think this gets a big +1, and I suggest someone should file an issue
> about finding and fixing all loops where we use iteration pools in this way.

All those loops probably look like:

subpool = svn_pool_create(pool);

while (condition)
  {
    ...

    if (some_other_condition)
      continue;

    ...

    svn_pool_clear(subpool);
  }

svn_pool_destroy(subpool);

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);

Very obvious, but I'm pointing it out just in case.

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:23:24 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.