Re: [PATCH] lookup_object: remove hashtable_index() and optimize hash_obj()

2013-09-12 Thread Junio C Hamano
Nicolas Pitre n...@fluxnic.net writes: Maybe it's worth squashing in one or both of the comments below as a warning to anybody who tries to tweak it. Agreed. @Junio: are you willing to squash those in, or do you prefer a resent? I think I've queued it ready to be squashed. No need for

Re: [PATCH] lookup_object: remove hashtable_index() and optimize hash_obj()

2013-09-12 Thread Nicolas Pitre
On Wed, 11 Sep 2013, Jeff King wrote: On Tue, Sep 10, 2013 at 06:17:12PM -0400, Nicolas Pitre wrote: Also remove the modulus as this is an expansive operation. The size argument is always a power of 2 anyway, so a simple mask operation provides the same result. On a 'git rev-list

Re: [PATCH] lookup_object: remove hashtable_index() and optimize hash_obj()

2013-09-11 Thread Jeff King
On Tue, Sep 10, 2013 at 06:17:12PM -0400, Nicolas Pitre wrote: hashtable_index() appears to be a close duplicate of hash_obj(). Keep only the later and make it usable for all cases. Thanks. This duplication has often bugged me when looking at that hash table, but I just never actually wrote

[PATCH] lookup_object: remove hashtable_index() and optimize hash_obj()

2013-09-10 Thread Nicolas Pitre
hashtable_index() appears to be a close duplicate of hash_obj(). Keep only the later and make it usable for all cases. Also remove the modulus as this is an expansive operation. The size argument is always a power of 2 anyway, so a simple mask operation provides the same result. On a 'git