Re: [PATCH v2] oidmap: map with OID as key

2017-10-04 Thread Junio C Hamano
Jeff King writes: > On Tue, Oct 03, 2017 at 05:29:01PM -0700, Jonathan Tan wrote: > >> At this point I decided that I prefer the thin wrapper, but the "light >> touch" (struct oidmap_entry, oidcmpfn(), oidmap_get() only) still >> better than the status quo. > > OK. I can certainly

Re: [PATCH v2] oidmap: map with OID as key

2017-10-04 Thread Jeff King
On Tue, Oct 03, 2017 at 05:29:01PM -0700, Jonathan Tan wrote: > At this point I decided that I prefer the thin wrapper, but the "light > touch" (struct oidmap_entry, oidcmpfn(), oidmap_get() only) still > better than the status quo. OK. I can certainly live with that. And worst case, I suppose,

Re: [PATCH v2] oidmap: map with OID as key

2017-10-03 Thread Jonathan Tan
On Mon, Oct 2, 2017 at 11:31 PM, Jeff King wrote: > Right, I kind of wonder if this has fallen into an uncanny value where > we have this almost-hashmap infrastructure, but the end result is not > significantly easier to use than a plain-old hashmap. > > I.e., it looks like you

Re: [PATCH v2] oidmap: map with OID as key

2017-10-03 Thread Jeff King
On Mon, Oct 02, 2017 at 04:48:48PM -0700, Brandon Williams wrote: > > Some replies to v1 [1] [2] seem to indicate that simpler non-duplicated > > code should be preferred over optimizing away the storage of the 4-byte > > hash code, and I have no objection to that, so I have updated this code > >

Re: [PATCH v2] oidmap: map with OID as key

2017-10-02 Thread Brandon Williams
On 09/29, Jonathan Tan wrote: > This is similar to using the hashmap in hashmap.c, but with an > easier-to-use API. In particular, custom entry comparisons no longer > need to be written, and lookups can be done without constructing a > temporary entry structure. > > This is implemented as a thin

[PATCH v2] oidmap: map with OID as key

2017-09-29 Thread Jonathan Tan
This is similar to using the hashmap in hashmap.c, but with an easier-to-use API. In particular, custom entry comparisons no longer need to be written, and lookups can be done without constructing a temporary entry structure. This is implemented as a thin wrapper over the hashmap API. In