From eaf07b7d15e067305d33150eb98bf0351f9f4cbd Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Wed, 14 Feb 2024 15:25:11 +0100 Subject: oidset: refactor oidset_insert_from_set() In a following commit, we will need to add all the oids from a set into another set. In "list-objects-filter.c", there is already a static function called add_all() to do that. Let's rename this function oidset_insert_from_set() and move it into oidset.{c,h} to make it generally available. While at it, let's remove a useless `!= NULL`. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- oidset.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'oidset.h') diff --git a/oidset.h b/oidset.h index ba4a5a2cd3..262f4256d6 100644 --- a/oidset.h +++ b/oidset.h @@ -47,6 +47,12 @@ int oidset_contains(const struct oidset *set, const struct object_id *oid); */ int oidset_insert(struct oidset *set, const struct object_id *oid); +/** + * Insert all the oids that are in set 'src' into set 'dest'; a copy + * is made of each oid inserted into set 'dest'. + */ +void oidset_insert_from_set(struct oidset *dest, struct oidset *src); + /** * Remove the oid from the set. * -- cgit v1.3