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>
This commit is contained in:

committed by
Junio C Hamano

parent
314f354ee7
commit
c3a9ad3117
10
oidset.c
10
oidset.c
@ -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);
|
||||
|
Reference in New Issue
Block a user