From d0482b445bb4c22a3f866c849835e366ec0b14a7 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 4 Dec 2020 13:52:07 -0500 Subject: oid-array: make sort function public We sort the oid-array as a side effect of calling the lookup or unique-iteration functions. But callers may want to sort it themselves (especially as we add new iteration options in future patches). We'll also move the check of the "sorted" flag into the sort function, so callers don't have to remember to check it. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- oid-array.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'oid-array.h') diff --git a/oid-array.h b/oid-array.h index 2c8b64c393..6a22c0ac94 100644 --- a/oid-array.h +++ b/oid-array.h @@ -106,4 +106,9 @@ void oid_array_filter(struct oid_array *array, for_each_oid_fn want, void *cbdata); +/** + * Sort the array in order of ascending object id. + */ +void oid_array_sort(struct oid_array *array); + #endif /* OID_ARRAY_H */ -- cgit v1.2.1