subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1695879 - /subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/log.c
Date Fri, 14 Aug 2015 12:53:03 GMT
Author: stefan2
Date: Fri Aug 14 12:53:02 2015
New Revision: 1695879

URL: http://svn.apache.org/r1695879
Log:
On the svn-mergeinfo-normalizer branch:
Simplify some code.

* tools/client-side/svn-mergeinfo-normalizer/log.c
  (internalize): Allocate hash elements in the same pool as the hash itself.
  (log_entry_receiver): Update caller.

Modified:
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/log.c

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/log.c?rev=1695879&r1=1695878&r2=1695879&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/log.c
(original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/log.c
Fri Aug 14 12:53:02 2015
@@ -125,13 +125,13 @@ deletion_order(const void *lhs,
 static const char *
 internalize(apr_hash_t *unique_paths,
             const char *path,
-            apr_ssize_t path_len,
-            apr_pool_t *result_pool)
+            apr_ssize_t path_len)
 {
   const char *result = apr_hash_get(unique_paths, path, path_len);
   if (result == NULL)
     {
-      result = apr_pstrmemdup(result_pool, path, path_len);
+      apr_pool_t *pool = apr_hash_pool_get(unique_paths);
+      result = apr_pstrmemdup(pool, path, path_len);
       apr_hash_set(unique_paths, result, path_len, result);
     }
 
@@ -166,8 +166,7 @@ log_entry_receiver(void *baton,
       const char *path = apr_hash_this_key(hi);
       svn_log_changed_path_t *change = apr_hash_this_val(hi);
 
-      path = internalize(log->unique_paths, path, apr_hash_this_key_len(hi),
-                         log->pool);
+      path = internalize(log->unique_paths, path, apr_hash_this_key_len(hi));
       APR_ARRAY_PUSH(entry->paths, const char *) = path;
 
       if (change->action == 'D' || change->action == 'R')
@@ -186,8 +185,7 @@ log_entry_receiver(void *baton,
           copy->revision = log_entry->revision;
           copy->copyfrom_path = internalize(log->unique_paths,
                                             change->copyfrom_path,
-                                            strlen(change->copyfrom_path),
-                                            log->pool);
+                                            strlen(change->copyfrom_path));
           copy->copyfrom_revision = change->copyfrom_rev;
 
           APR_ARRAY_PUSH(log->copies, svn_min__copy_t *) = copy;
@@ -208,7 +206,7 @@ log_entry_receiver(void *baton,
                       APR_ARRAY_IDX(entry->paths, count - 1, const char *),
                       scratch_pool);
       entry->common_base = internalize(log->unique_paths, common_base,
-                                       strlen(common_base), log->pool);
+                                       strlen(common_base));
     }
 
   APR_ARRAY_PUSH(log->entries, log_entry_t *) = entry;



Mime
View raw message