diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2017-11-21 21:58:49 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-22 06:11:56 +0100 |
commit | c3a9ad311793e16f6f5c5dcc3559133700c70288 (patch) | |
tree | 43562a397e500c26e455411a946cfcb94fea3e18 /oidset.c | |
parent | oidmap: add oidmap iterator methods (diff) | |
download | git-c3a9ad311793e16f6f5c5dcc3559133700c70288.tar.xz git-c3a9ad311793e16f6f5c5dcc3559133700c70288.zip |
oidset: add iterator methods to oidset
Add the usual iterator methods to oidset.
Add oidset_remove().
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'oidset.c')
-rw-r--r-- | oidset.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -24,6 +24,16 @@ int oidset_insert(struct oidset *set, const struct object_id *oid) return 0; } +int oidset_remove(struct oidset *set, const struct object_id *oid) +{ + struct oidmap_entry *entry; + + entry = oidmap_remove(&set->map, oid); + free(entry); + + return (entry != NULL); +} + void oidset_clear(struct oidset *set) { oidmap_free(&set->map, 1); |