Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-09 Thread Karthik Nayak
On Sun, Feb 7, 2016 at 7:17 PM, Andreas Schwab wrote: > Karthik Nayak writes: > >> + if ((( arg && len == arg - sp) || >> +(!arg && len == ep - sp )) && > > len == (arg ? arg : ep) - sp && This is better I feel. Thank You -- Regards, Kar

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-07 Thread Andreas Schwab
Karthik Nayak writes: > + if ((( arg && len == arg - sp) || > +(!arg && len == ep - sp )) && len == (arg ? arg : ep) - sp && Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-07 Thread Eric Sunshine
On Sun, Feb 7, 2016 at 4:01 AM, Karthik Nayak wrote: > On Sun, Feb 7, 2016 at 12:03 PM, Eric Sunshine > wrote: >> On Sat, Feb 6, 2016 at 10:15 AM, Karthik Nayak wrote: >>> I think the code needs to be changed to: >>> >>> - if ((!arg || len == arg - sp) && >>> + if ((

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-07 Thread Karthik Nayak
On Sun, Feb 7, 2016 at 12:33 PM, Eric Sunshine wrote: > On Sat, Feb 6, 2016 at 9:36 AM, Karthik Nayak wrote: >> On Thu, Feb 4, 2016 at 3:49 AM, Eric Sunshine >> wrote: >>> On Sun, Jan 31, 2016 at 12:42 PM, Karthik Nayak >>> wrote: - const char *formatp = strchr(sp, ':'); >>

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-07 Thread Karthik Nayak
On Sun, Feb 7, 2016 at 12:03 PM, Eric Sunshine wrote: > On Sat, Feb 6, 2016 at 10:15 AM, Karthik Nayak wrote: >> On Sun, Jan 31, 2016 at 11:12 PM, Karthik Nayak >> wrote: >>> @@ -138,10 +140,9 @@ int parse_ref_filter_atom(const char *atom, const char >>> *ep) >>> * shouldn't b

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-06 Thread Eric Sunshine
On Sat, Feb 6, 2016 at 9:36 AM, Karthik Nayak wrote: > On Thu, Feb 4, 2016 at 3:49 AM, Eric Sunshine wrote: >> On Sun, Jan 31, 2016 at 12:42 PM, Karthik Nayak >> wrote: >>> - const char *formatp = strchr(sp, ':'); >>> - if (!formatp || ep < formatp) >>> -

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-06 Thread Eric Sunshine
On Sat, Feb 6, 2016 at 10:15 AM, Karthik Nayak wrote: > On Sun, Jan 31, 2016 at 11:12 PM, Karthik Nayak wrote: >> @@ -138,10 +140,9 @@ int parse_ref_filter_atom(const char *atom, const char >> *ep) >> * shouldn't be used for checking against the valid_atom >> *

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-06 Thread Karthik Nayak
On Sun, Jan 31, 2016 at 11:12 PM, Karthik Nayak wrote: > @@ -138,10 +140,9 @@ int parse_ref_filter_atom(const char *atom, const char > *ep) > * shouldn't be used for checking against the valid_atom > * table. > */ > - const char *fo

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-06 Thread Karthik Nayak
On Thu, Feb 4, 2016 at 3:49 AM, Eric Sunshine wrote: > On Sun, Jan 31, 2016 at 12:42 PM, Karthik Nayak wrote: >> Parsing atoms is done in populate_value(), this is repetitive and >> hence expensive. Introduce a parsing function which would let us parse >> atoms beforehand and store the required d

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-03 Thread Junio C Hamano
Eric Sunshine writes: >> @@ -138,10 +140,9 @@ int parse_ref_filter_atom(const char *atom, const char >> *ep) >> * shouldn't be used for checking against the valid_atom >> * table. >> */ >> - const char *formatp = strchr(sp, ':'); >

Re: [PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-03 Thread Eric Sunshine
On Sun, Jan 31, 2016 at 12:42 PM, Karthik Nayak wrote: > Parsing atoms is done in populate_value(), this is repetitive and > hence expensive. Introduce a parsing function which would let us parse > atoms beforehand and store the required details into the 'used_atom' > structure for further usage.

[PATCH v4 05/12] ref-filter: introduce parsing functions for each valid atom

2016-01-31 Thread Karthik Nayak
Parsing atoms is done in populate_value(), this is repetitive and hence expensive. Introduce a parsing function which would let us parse atoms beforehand and store the required details into the 'used_atom' structure for further usage. Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- re