Author: artagnon
Date: Wed Sep 29 07:52:55 2010
New Revision: 1002503

URL: http://svn.apache.org/viewvc?rev=1002503&view=rev
Log:
svnrdump: dump_editor: Avoid duplicating strings unnecessarily

* subversion/svnrdump/dump_editor.c

  (open_directory, close_directory, make_dir_baton): Instead of first
  allocating `copyfrom_path` in `pool` and then copying it to
  `eb->pool`, allocate it in `eb->pool` in the first place.

  (make_dir_baton): Don't unnecessarily copy a simple static string:
  let `abspath` point to a static string if `pb` does not exist.

Modified:
    subversion/trunk/subversion/svnrdump/dump_editor.c

Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=1002503&r1=1002502&r2=1002503&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Wed Sep 29 07:52:55 2010
@@ -132,7 +132,7 @@ make_dir_baton(const char *path,
   if (pb)
     abspath = svn_uri_join("/", path, pool);
   else
-    abspath = apr_pstrdup(pool, "/");
+    abspath = "/";
 
   /* Strip leading slash from copyfrom_path so that the path is
      canonical and svn_relpath_join can be used */
@@ -143,8 +143,7 @@ make_dir_baton(const char *path,
   new_db->eb = eb;
   new_db->parent_dir_baton = pb;
   new_db->abspath = abspath;
-  new_db->copyfrom_path = copyfrom_path ?
-    apr_pstrdup(pool, copyfrom_path) : NULL;
+  new_db->copyfrom_path = copyfrom_path;
   new_db->copyfrom_rev = copyfrom_rev;
   new_db->added = added;
   new_db->written_out = FALSE;
@@ -479,7 +478,7 @@ open_directory(const char *path,
     {
       copyfrom_path = svn_uri_join(pb->copyfrom_path,
                                    svn_relpath_basename(path, NULL),
-                                   pool);
+                                   pb->eb->pool);
       copyfrom_rev = pb->copyfrom_rev;
     }
 
@@ -593,7 +592,7 @@ open_file(const char *path,
     {
       copyfrom_path = svn_relpath_join(pb->copyfrom_path,
                                        svn_relpath_basename(path, NULL),
-                                       pool);
+                                       pb->eb->pool);
       copyfrom_rev = pb->copyfrom_rev;
     }
 


Reply via email to