diff options
| author | Patrick Steinhardt <ps@pks.im> | 2018-11-23 18:38:18 +0100 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2018-11-28 15:22:27 +0100 |
| commit | 382b668bf2019eb8fb7c0afc4d6e3132dca9510e (patch) | |
| tree | bbf4314f4ec75a09f87845814e047e3394f03fae /src/strmap.c | |
| parent | ae765d0013e767e0c3824eea439a606b81f3083a (diff) | |
| download | libgit2-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/strmap.c')
| -rw-r--r-- | src/strmap.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/strmap.c b/src/strmap.c index de6826d03..d9d89aa1b 100644 --- a/src/strmap.c +++ b/src/strmap.c @@ -102,6 +102,17 @@ void git_strmap_delete(git_strmap *map, const char *key) git_strmap_delete_at(map, idx); } +size_t git_strmap_begin(git_strmap *map) +{ + GIT_UNUSED(map); + return 0; +} + +size_t git_strmap_end(git_strmap *map) +{ + return map->n_buckets; +} + int git_strmap_next( void **data, git_strmap_iter* iter, |
