[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1544716 - /subversion/trunk/subversion/libsvn_subr/config_file.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 23 Nov 2013 14:52:39 +0200

stefan2_at_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" ?
Received on 2013-11-23 13:53:22 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.