[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] dfa: optimize UTF-8 period
From: |
Jim Meyering |
Subject: |
Re: [PATCH 3/3] dfa: optimize UTF-8 period |
Date: |
Sat, 17 Apr 2010 09:27:30 +0200 |
Paolo Bonzini wrote:
> * NEWS: Document improvement.
> * src/dfa.c (struct dfa): Add utf8_anychar_classes.
> (add_utf8_anychar): New.
> (atom): Simplify if/else nesting. Call add_utf8_anychar for ANYCHAR
> in UTF-8 locales.
> (dfaoptimize): Abort on ANYCHAR.
> ---
> NEWS | 6 ++++++
> src/dfa.c | 46 +++++++++++++++++++++++++++++++++++++++++++---
> 2 files changed, 49 insertions(+), 3 deletions(-)
>
> diff --git a/NEWS b/NEWS
> index bcca373..80074a7 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -9,6 +9,12 @@ GNU grep NEWS -*- outline
> -*-
>
> X{0,0} is implemented correctly. It used to be a synonym of X{0,1}.
> [bug present since "the beginning"]
> +____<<---
Only quick superficial feedback for now:
There are trailing blanks in the NEWS addition, above.
Also, please make this new struct const:
static charclass utf8_classes[5] = {
static const charclass utf8_classes[5] = {
> @@ -1513,8 +1543,11 @@ addtok_wc (wint_t wc)
> static void
> atom (void)
> {
> + if (0)
> + ;
> +
> #if MBS_SUPPORT
> - if (tok == WCHAR)
> + else if (tok == WCHAR)
> {
> addtok_wc (case_fold ? towlower(wctok) : wctok);
> #ifndef GREP
Please write that like this,
if (0)
{
/* empty */
}
#if MBS_SUPPORT
else if (tok == WCHAR)
But especially with no blank line between the "if" block
and the #if MBS_SUPPORT.
Re: [PATCH 1/3] dfa: simplify dfainit, Jim Meyering, 2010/04/17