[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 7905 - trunk/subversion/libsvn_client

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-12-03 00:40:34 CET

Philip Martin wrote:
> julianfoad@tigris.org writes:
>
>>- for (err = svn_io_dir_read (&finfo, flags, dir, subpool);
>>- err == SVN_NO_ERROR;
>>- svn_pool_clear (subpool),
>>- err = svn_io_dir_read (&finfo, flags, dir, subpool))
>>+ SVN_ERR (svn_io_get_dirents (&dirents, path, pool));
>>+
>>+ for (hi = apr_hash_first (pool, dirents);
>>+ hi;
>>+ svn_pool_clear (subpool), hi = apr_hash_next (hi))
>
> I'd classify that as gratuitous use of the comma operator :)
>
> Looking at the old code I see that it is using the subpool in
> svn_io_dir_read, which probably explains why the comma got used
> originally. Your code doesn't need it. Do people like this use of
> the comma operator?

I don't much like it, but I hadn't spotted the reason for it that you point out. Now that I know that, I am happy to remove the comma and move the pool clearing into the body of the loop.

Thanks for pointing it out.

I see now that I also left a variable that is now unused.

Fixed both in r7914.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 3 00:36:42 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.