diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2017-11-21 20:58:49 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-22 14:11:56 +0900 |
commit | c3a9ad311793e16f6f5c5dcc3559133700c70288 (patch) | |
tree | 43562a397e500c26e455411a946cfcb94fea3e18 /oidset.c | |
parent | 314f354ee77892664f49b4b44d2052df139ece7e (diff) | |
download | git-c3a9ad311793e16f6f5c5dcc3559133700c70288.tar.gz |
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); |