]> git.ipfire.org Git - thirdparty/git.git/commit - oidset.h
oidmap: map with OID as key
authorJonathan Tan <jonathantanmy@google.com>
Fri, 29 Sep 2017 22:54:22 +0000 (15:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 1 Oct 2017 08:18:03 +0000 (17:18 +0900)
commit9e6fabde82e91366a7fea5a81e795d26bbe7e10d
treeacaf49902bbb6a41be5883e6a183a98e05380ea5
parentea220ee40cbb03a63ebad2be902057bf742492fd
oidmap: map with OID as key

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
particular, this means that there is an additional 4-byte overhead due
to the fact that the first 4 bytes of the hash is redundantly stored.
For now, I'm taking the simpler approach, but if need be, we can
reimplement oidmap without affecting the callers significantly.

oidset has been updated to use oidmap.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
fetch-pack.c
oidmap.c [new file with mode: 0644]
oidmap.h [new file with mode: 0644]
oidset.c
oidset.h