4 int oidset_contains(const struct oidset *set, const struct object_id *oid)
6 if (!set->map.map.tablesize)
8 return !!oidmap_get(&set->map, oid);
11 int oidset_insert(struct oidset *set, const struct object_id *oid)
13 struct oidmap_entry *entry;
15 if (!set->map.map.tablesize)
16 oidmap_init(&set->map, 0);
17 else if (oidset_contains(set, oid))
20 entry = xmalloc(sizeof(*entry));
21 oidcpy(&entry->oid, oid);
23 oidmap_put(&set->map, entry);
27 void oidset_clear(struct oidset *set)
29 oidmap_free(&set->map, 1);