subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1575979 - /subversion/trunk/subversion/libsvn_repos/load.c
Date Mon, 10 Mar 2014 16:03:01 GMT
Author: julianfoad
Date: Mon Mar 10 16:03:01 2014
New Revision: 1575979

Remove a redundant empty write, because redundant code is annoying to read.

It sent me on a wild goose chase through the code to discover what it's for,
only to find in the end it's for nothing. The API we are providing does not
promise it, the called APIs do not require it nor guarantee to do anything
with it, and the 'svnadmin load' code does not need it. It originated as an
innocent-looking single line in r842201 and then grew to its current form in
r842708, all in the pre-1.0 era.

This code was only reached for a fulltext, never for a delta.
(svn_txdelta_parse_svndiff() treats a close after no data bytes were
received as an "early" close, and so would return an error on closing the
stream if we ever processed a zero-length delta block in this function.)

An API user would be able to see this change but should not be relying on it.

* subversion/libsvn_repos/load.c
  (parse_text_block): Remove an empty write to the stream in the case of an
    empty content block.


Modified: subversion/trunk/subversion/libsvn_repos/load.c
--- subversion/trunk/subversion/libsvn_repos/load.c (original)
+++ subversion/trunk/subversion/libsvn_repos/load.c Mon Mar 10 16:03:01 2014
@@ -317,15 +317,6 @@ parse_text_block(svn_stream_t *stream,
       SVN_ERR(parse_fns->set_fulltext(&text_stream, record_baton));
-  /* If there are no contents to read, just write an empty buffer
-     through our callback. */
-  if (content_length == 0)
-    {
-      wlen = 0;
-      if (text_stream)
-        SVN_ERR(svn_stream_write(text_stream, "", &wlen));
-    }
   /* Regardless of whether or not we have a sink for our data, we
      need to read it. */
   while (content_length)

View raw message