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

[PATCH] why not loop through apr_hash_t with pool as NULL.

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-06 21:18:30 CEST

Hi All,
Found a snippet of code in subversion/libsvn_fs_base/tree.c where we
create a separate subpool which is passed to apr_hash_first alone. And
this subpool can be replaced by NULL.
With this change I ran 'make check FS_TYPE=bdb' and observed same
behaviour without this change.

Can someone consider this patch?

With regards
Kamesh Jayachandran

Patch by: Kamesh Jayachandran <kamesh@collab.net>

  Why to create subpool to iterate the apr_hash_t rather iterate with
  a NULL as pool.

* subversion/libsvn_fs_base/tree.c
   Don't create subpool to iterate over the apr_hash_t rather pass NULL as
   pool to apr_hash_first.


Index: subversion/libsvn_fs_base/tree.c
--- subversion/libsvn_fs_base/tree.c (revision 21795)
+++ subversion/libsvn_fs_base/tree.c (working copy)
@@ -1465,8 +1465,7 @@
   if (table)
       apr_hash_index_t *hi;
- apr_pool_t *subpool = svn_pool_create(pool);
- for (hi = apr_hash_first(subpool, table); hi; hi = apr_hash_next(hi))
+ for (hi = apr_hash_first(NULL, table); hi; hi = apr_hash_next(hi))
           svn_fs_dirent_t *entry;
           struct node_kind_args nk_args;

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 6 21:18:04 2006

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.