julianfoad@tigris.org writes:
> Author: julianfoad
> Date: Tue Dec 2 12:33:53 2003
> New Revision: 7905
>
> Modified:
> trunk/subversion/libsvn_client/commit.c
> Log:
> Simplify code in 'import_dir' by using a library function.
>
> * subversion/libsvn_client/commit.c (import_dir)
> Call svn_io_get_dirents instead of doing the hard work manually.
>
>
> Modified: trunk/subversion/libsvn_client/commit.c
> ==============================================================================
> --- trunk/subversion/libsvn_client/commit.c (original)
> +++ trunk/subversion/libsvn_client/commit.c Tue Dec 2 12:33:53 2003
> @@ -177,40 +177,34 @@
> apr_pool_t *pool)
> {
> apr_pool_t *subpool = svn_pool_create (pool); /* iteration pool */
> - apr_dir_t *dir;
> - apr_finfo_t finfo;
> - apr_status_t apr_err;
> + apr_hash_t *dirents;
> + apr_hash_index_t *hi;
> apr_int32_t flags = APR_FINFO_TYPE | APR_FINFO_NAME;
> - svn_error_t *err;
> apr_array_header_t *ignores;
>
> - SVN_ERR (svn_io_dir_open (&dir, path, pool));
> -
> SVN_ERR (svn_wc_get_default_ignores (&ignores, ctx->config, pool));
>
> - 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?
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 2 21:33:05 2003