On Sat, Nov 23, 2013 at 1:52 PM, Daniel Shahaf <d...@daniel.shahaf.name>wrote:
> stef...@apache.org wrote on Sat, Nov 23, 2013 at 00:09:55 -0000: > > Author: stefan2 > > Date: Sat Nov 23 00:09:55 2013 > > New Revision: 1544716 > > > > URL: http://svn.apache.org/r1544716 > > Log: > > * subversion/libsvn_subr/config_file.c > > (skip_to_eoln): Newer FSFS config files contain lots of commentary. > > Make the parser skip that quickly. > > > > Modified: > > subversion/trunk/subversion/libsvn_subr/config_file.c > > > > Modified: subversion/trunk/subversion/libsvn_subr/config_file.c > > URL: > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1544716&r1=1544715&r2=1544716&view=diff > > > ============================================================================== > > --- subversion/trunk/subversion/libsvn_subr/config_file.c (original) > > +++ subversion/trunk/subversion/libsvn_subr/config_file.c Sat Nov 23 > 00:09:55 2013 > > @@ -185,7 +185,21 @@ skip_to_eoln(parse_context_t *ctx, int * > > > > SVN_ERR(parser_getc(ctx, &ch)); > > while (ch != '\n' && ch != EOF) > > - SVN_ERR(parser_getc_plain(ctx, &ch)); > > + { > > + /* This is much faster than checking individual bytes. > > + * We use this function a lot when skipping comment lines. */ > > + const char *newline = memchr(ctx->parser_buffer + ctx->buffer_pos, > > + '\n', ctx->buffer_size); > > Last parameter needs to be "size - pos" ? > Yup. Bert beat me on fixing this. Thanks for the review! -- Stefan^2