Re: [cxx-conversion] various hash tables, part 1/2

2012-12-03 Thread Diego Novillo
On Mon, Dec 3, 2012 at 2:50 PM, Lawrence Crowl wrote: > On 12/3/12, Diego Novillo wrote: >> On 2012-12-03 14:24 , Lawrence Crowl wrote: > -static int > -htab_cu_eq (const void *of1, const void *of2) > +inline bool > +cu_hash_table_entry_hasher::equal (const value_type *entry1, >>>

Re: [cxx-conversion] various hash tables, part 1/2

2012-12-03 Thread Lawrence Crowl
On 12/3/12, Diego Novillo wrote: > On 2012-12-03 14:24 , Lawrence Crowl wrote: -static int -htab_cu_eq (const void *of1, const void *of2) +inline bool +cu_hash_table_entry_hasher::equal (const value_type *entry1, + const compare_type *entry

Re: [cxx-conversion] various hash tables, part 1/2

2012-12-03 Thread Diego Novillo
On 2012-12-03 14:24 , Lawrence Crowl wrote: } -static int -htab_cu_eq (const void *of1, const void *of2) +inline bool +cu_hash_table_entry_hasher::equal (const value_type *entry1, + const compare_type *entry2) No static? The in-class declaration has the

Re: [cxx-conversion] various hash tables, part 1/2

2012-12-03 Thread Lawrence Crowl
On 12/3/12, Diego Novillo wrote: > On Sat, Dec 1, 2012 at 8:47 PM, Lawrence Crowl wrote: > >> +inline bool >> +attribute_hasher::equal (const value_type *spec, const compare_type >> *str) >> +{ >> + return (!strncmp (spec->name, str->str, str->length) > > I have a slight preference for strncmp()

Re: [cxx-conversion] various hash tables, part 1/2

2012-12-03 Thread Diego Novillo
On Sat, Dec 1, 2012 at 8:47 PM, Lawrence Crowl wrote: > +inline bool > +attribute_hasher::equal (const value_type *spec, const compare_type *str) > +{ > + return (!strncmp (spec->name, str->str, str->length) I have a slight preference for strncmp() == 0. It's easier to read (I realize that you