On Thu, 2011-06-02, Stefan Fuhrmann wrote:
> On 01.06.2011 17:06, Julian Foad wrote:
> >> svn_error_t *
> >> svn_stream_skip(svn_stream_t *stream, apr_size_t *len)
> >> {
> >>    SVN_ERR_ASSERT(stream->skip_fn != NULL);
> > This should call the default skip implementation (which reads and
> > discards) when a stream doesn't implement its own skip function.  That
> > way, 'skip' will be available on any generic stream, which is better
> > than the caller having to know (either implicitly or by calling a test
> > function) whether the stream has a skip function installed.
> Agreed.
> >>    return stream->skip_fn(stream->baton, len);
> >> }
> >
> >> static svn_error_t *
> >> skip_handler_empty(void *baton, apr_size_t *count)
> >> {
> >>    *count = 0;
> >>    return SVN_NO_ERROR;
> >> }
> > I thought a skip handler was supposed to return an error when asked to
> > read past EOF.  This one doesn't.  Anyway, if we make the above change
> > then we can get rid of this handler; the empty stream doesn't need one.
> +1. This function is unlikely to be called for an empty
>   stream anyways.
> 
> >> static svn_boolean_t
> >> is_buffered_handler_empty(void *baton)
> >> {
> >>    return FALSE;
> >> }
> > We don't need this handler, because there's a default for streams that
> > don't supply a handler.
> Back then, I had just discovered that translated streams (?)
> did not provide a specialized skip() implementation. That
> prompted me to look for any "missing" handler.
> 
> But this one is indeed not needed.

Done in r1130490: "Change svn_stream_skip() so that if no skip handler
is provided it will still work by reading from the stream, and so remove
three trivial handlers."

- Julian


Reply via email to