Author: julianfoad
Date: Fri May 27 13:30:40 2011
New Revision: 1128298

URL: http://svn.apache.org/viewvc?rev=1128298&view=rev
Log:
* subversion/libsvn_fs_fs/fs_fs.c
  (write_format): Eliminate a redundant deep-copied string.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1128298&r1=1128297&r2=1128298&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Fri May 27 13:30:40 2011
@@ -1023,7 +1023,6 @@ write_format(const char *path, int forma
              svn_boolean_t overwrite, apr_pool_t *pool)
 {
   svn_stringbuf_t *sb;
-  svn_string_t *contents;
 
   SVN_ERR_ASSERT(1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER);
 
@@ -1038,15 +1037,13 @@ write_format(const char *path, int forma
         svn_stringbuf_appendcstr(sb, "layout linear\n");
     }
 
-  contents = svn_string_create_from_buf(sb, pool);
-
   /* svn_io_write_version_file() does a load of magic to allow it to
      replace version files that already exist.  We only need to do
      that when we're allowed to overwrite an existing file. */
   if (! overwrite)
     {
       /* Create the file */
-      SVN_ERR(svn_io_file_create(path, contents->data, pool));
+      SVN_ERR(svn_io_file_create(path, sb->data, pool));
     }
   else
     {
@@ -1054,7 +1051,7 @@ write_format(const char *path, int forma
 
       SVN_ERR(svn_io_write_unique(&path_tmp,
                                   svn_dirent_dirname(path, pool),
-                                  contents->data, contents->len,
+                                  sb->data, sb->len,
                                   svn_io_file_del_none, pool));
 
       /* rename the temp file as the real destination */


Reply via email to