* /subversion/libsvn_subr/io.c (svn_io_file_read_full2): Assume that eof_is_ok argument is always TRUE and use a pointer to a boolean variable to pass back information about detected EOF. (contents_identical_p): use *_read_full2() to minimize EOF detection overhead, like r985488 did but was reverted in r995478. Index: io.c =================================================================== --- io.c (revision 996063) +++ io.c (working copy) @@ -2875,12 +2875,14 @@ svn_error_t * svn_io_file_read_full2(apr_file_t *file, void *buf, apr_size_t nbytes, apr_size_t *bytes_read, - svn_boolean_t eof_is_ok, + svn_boolean_t* eof_flag, apr_pool_t *pool) { apr_status_t status = apr_file_read_full(file, buf, nbytes, bytes_read); - if (APR_STATUS_IS_EOF(status) && eof_is_ok) + if (APR_STATUS_IS_EOF(status)) { + *eof_flag = TRUE; return SVN_NO_ERROR; + } return do_io_file_wrapper_cleanup (file, status, @@ -3607,26 +3609,14 @@ *identical_p = TRUE; /* assume TRUE, until disproved below */ while (! (done1 || done2)) { - err = svn_io_file_read_full(file1_h, buf1, - SVN__STREAM_CHUNK_SIZE, &bytes_read1, pool); - if (err && APR_STATUS_IS_EOF(err->apr_err)) - { - svn_error_clear(err); - err = NULL; - done1 = TRUE; - } - else if (err) + err = svn_io_file_read_full2(file1_h, buf1, + SVN__STREAM_CHUNK_SIZE, &bytes_read1, &done1, pool); + if (err) break; - err = svn_io_file_read_full(file2_h, buf2, - SVN__STREAM_CHUNK_SIZE, &bytes_read2, pool); - if (err && APR_STATUS_IS_EOF(err->apr_err)) - { - svn_error_clear(err); - err = NULL; - done2 = TRUE; - } - else if (err) + err = svn_io_file_read_full2(file2_h, buf2, + SVN__STREAM_CHUNK_SIZE, &bytes_read2, &done2, pool); + if (err) break; if ((bytes_read1 != bytes_read2)