diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-06-29 16:43:20 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-06-29 16:43:21 -0700 |
| commit | a1264a08a1a6e0cd7e510c899cd0ba42dcf1045d (patch) | |
| tree | d6a22be96e39e1284d9838ce5e8ad58941c5099b /hashmap.h | |
| parent | b2166b0d496c2f3df96929da300039a01227e719 (diff) | |
| parent | 68d686460f58e45f2eb080e0cdf314987eca5ce5 (diff) | |
| download | git-a1264a08a1a6e0cd7e510c899cd0ba42dcf1045d.tar.xz | |
Merge branch 'en/header-split-cache-h-part-3'
Header files cleanup.
* en/header-split-cache-h-part-3: (28 commits)
fsmonitor-ll.h: split this header out of fsmonitor.h
hash-ll, hashmap: move oidhash() to hash-ll
object-store-ll.h: split this header out of object-store.h
khash: name the structs that khash declares
merge-ll: rename from ll-merge
git-compat-util.h: remove unneccessary include of wildmatch.h
builtin.h: remove unneccessary includes
list-objects-filter-options.h: remove unneccessary include
diff.h: remove unnecessary include of oidset.h
repository: remove unnecessary include of path.h
log-tree: replace include of revision.h with simple forward declaration
cache.h: remove this no-longer-used header
read-cache*.h: move declarations for read-cache.c functions from cache.h
repository.h: move declaration of the_index from cache.h
merge.h: move declarations for merge.c from cache.h
diff.h: move declaration for global in diff.c from cache.h
preload-index.h: move declarations for preload-index.c from elsewhere
sparse-index.h: move declarations for sparse-index.c from cache.h
name-hash.h: move declarations for name-hash.c from cache.h
run-command.h: move declarations for run-command.c from cache.h
...
Diffstat (limited to 'hashmap.h')
| -rw-r--r-- | hashmap.h | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -1,8 +1,6 @@ #ifndef HASHMAP_H #define HASHMAP_H -#include "hash-ll.h" - /* * Generic implementation of hash-based key-value mappings. * @@ -121,25 +119,6 @@ unsigned int memihash(const void *buf, size_t len); unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len); /* - * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code - * for use in hash tables. Cryptographic hashes are supposed to have - * uniform distribution, so in contrast to `memhash()`, this just copies - * the first `sizeof(int)` bytes without shuffling any bits. Note that - * the results will be different on big-endian and little-endian - * platforms, so they should not be stored or transferred over the net. - */ -static inline unsigned int oidhash(const struct object_id *oid) -{ - /* - * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on - * platforms that don't support unaligned reads. - */ - unsigned int hash; - memcpy(&hash, oid->hash, sizeof(hash)); - return hash; -} - -/* * struct hashmap_entry is an opaque structure representing an entry in the * hash table. * Ideally it should be followed by an int-sized member to prevent unused |
