From 6fc9fec07bcaa6561aff5b485f1ac581f97a2428 Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Sat, 16 Jul 2022 18:59:59 +0200 Subject: fetch-pack: use DEFINE_LIST_SORT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build a static typed ref sorting function using DEFINE_LIST_SORT along with a typed comparison function near its only two callers instead of having an exported version that calls llist_mergesort(). This gets rid of the next pointer accessor functions and their calling overhead at the cost of a slightly increased object text size. Before: __TEXT __DATA __OBJC others dec hex 23231 389 0 113689 137309 2185d fetch-pack.o 29158 80 0 146864 176102 2afe6 remote.o With this patch: __TEXT __DATA __OBJC others dec hex 23591 389 0 117759 141739 229ab fetch-pack.o 29070 80 0 145718 174868 2ab14 remote.o Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- remote.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'remote.h') diff --git a/remote.h b/remote.h index 4a1209ae2c..af27bb7e7e 100644 --- a/remote.h +++ b/remote.h @@ -207,9 +207,7 @@ struct ref *find_ref_by_name(const struct ref *list, const char *name); struct ref *alloc_ref(const char *name); struct ref *copy_ref(const struct ref *ref); struct ref *copy_ref_list(const struct ref *ref); -void sort_ref_list(struct ref **, int (*cmp)(const void *, const void *)); int count_refspec_match(const char *, struct ref *refs, struct ref **matched_ref); -int ref_compare_name(const void *, const void *); int check_ref_type(const struct ref *ref, int flags); -- cgit v1.3-5-g9baa