bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG]


From: Hideki IWAMOTO
Subject: Re: [BUG]
Date: Sat, 14 Sep 2013 13:01:34 +0900

Hi. Yamaguchi san.

> How about the following?

This new code seems to be good. 


On Sat, 14 Sep 2013 08:15:38 +0900
Shigio YAMAGUCHI <address@hidden> wrote:

> 
> [This code replaces the 617-631]
> 
>       /*
>        * If the pattern is '^' + <non regular expression> like '^aaa',
>        * we take prefix read method with the non regular expression part
>        * as a prefix.
>        */
>       if (!(flags & GTOP_IGNORECASE) && *pattern == '^' && !isregex(pattern + 
> 1)) {
>               key = pattern + 1;
>               dbflags |= DBOP_PREFIX;
>       } else {
> 
> This code rescues '^' + <non regular expression> like '^set' at least.
> 
> [removed]
> $ /usr/bin/time global -xs '^set' > /tmp/out1
>         0.44 real         0.30 user         0.12 sys
> [using this code]
> $ /usr/bin/time global -xs '^set' > /tmp/out2
>         0.08 real         0.05 user         0.02 sys
> $ diff /tmp/out1 /tmp/out2
> $
> (tested using FreeBSD kernel source)
> 
> This code works well in the following cases too:
> 
> $ global -sx ^v?sprintf
> sprintf             2 a.c              sprintf
> vsprintf            1 a.c              vsprintf
> $ global -sx ^(v)?sprintf
> sprintf             2 a.c              sprintf
> vsprintf            1 a.c              vsprintf
> $ global -sx ^get|^set
> geta                1 b.c              geta
> seta                2 b.c              seta
> $ global -sx (^get)|(^set)
> geta                1 b.c              geta
> seta                2 b.c              seta
> 
> > -- 
> > Hideki IWAMOTO <address@hidden>
> -- 
> Shigio YAMAGUCHI <address@hidden>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

-- 
Hideki IWAMOTO <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]