summaryrefslogtreecommitdiff
path: root/src/offmap.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-11-23 18:38:18 +0100
committerPatrick Steinhardt <ps@pks.im>2018-11-28 15:22:27 +0100
commit382b668bf2019eb8fb7c0afc4d6e3132dca9510e (patch)
treebbf4314f4ec75a09f87845814e047e3394f03fae /src/offmap.c
parentae765d0013e767e0c3824eea439a606b81f3083a (diff)
downloadlibgit2-382b668bf2019eb8fb7c0afc4d6e3132dca9510e.tar.gz
khash: implement begin/end via functions instead of macros
Right now, the `git_*map_begin()` and `git_*map_end()` helpers are implemented via macros which simply redirect to `kh_begin` and `kh_end`. As these macros refer to members of the map structures, they make it impossible to move the khash include into the implementation files. Implement these helpers as real functions instead to further decouple the headers from implementations.
Diffstat (limited to 'src/offmap.c')
-rw-r--r--src/offmap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/offmap.c b/src/offmap.c
index ab6649697..2ab485589 100644
--- a/src/offmap.c
+++ b/src/offmap.c
@@ -81,3 +81,14 @@ void git_offmap_delete(git_offmap *map, const git_off_t key)
if (git_offmap_valid_index(map, idx))
git_offmap_delete_at(map, idx);
}
+
+size_t git_offmap_begin(git_offmap *map)
+{
+ GIT_UNUSED(map);
+ return 0;
+}
+
+size_t git_offmap_end(git_offmap *map)
+{
+ return map->n_buckets;
+}