Skip to contentSkip to conversation

object.c: remove unused functions

PATCH New しらいしななこ 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 object.c: remove unused functions

Removes unused functions object_list_append(), object_list_legnth() and bject_list_contains().

---

This is my first foray into C programming, so please be kind.

 object.c |   31 -------------------------------
 object.h |    7 -------
 2 files changed, 0 insertions(+), 38 deletions(-)
object.c +0 -31
index 50b6528..b386d58 100644
@@ -215,37 +215,6 @@ struct object_list *object_list_insert(struct object *item,
         return new_list;
 }
 
-void object_list_append(struct object *item,
-			struct object_list **list_p)
-{
-	while (*list_p) {
-		list_p = &((*list_p)->next);
-	}
-	*list_p = xmalloc(sizeof(struct object_list));
-	(*list_p)->next = NULL;
-	(*list_p)->item = item;
-}
-
-unsigned object_list_length(struct object_list *list)
-{
-	unsigned ret = 0;
-	while (list) {
-		list = list->next;
-		ret++;
-	}
-	return ret;
-}
-
-int object_list_contains(struct object_list *list, struct object *obj)
-{
-	while (list) {
-		if (list->item == obj)
-			return 1;
-		list = list->next;
-	}
-	return 0;
-}
-
 void add_object_array(struct object *obj, const char *name, struct object_array *array)
 {
 	add_object_array_with_mode(obj, name, array, S_IFINVALID);
object.h +0 -7
index 036bd66..8405fd2 100644
@@ -61,13 +61,6 @@ struct object *lookup_unknown_object(const unsigned  char *sha1);
 struct object_list *object_list_insert(struct object *item,
 				       struct object_list **list_p);
 
-void object_list_append(struct object *item,
-			struct object_list **list_p);
-
-unsigned object_list_length(struct object_list *list);
-
-int object_list_contains(struct object_list *list, struct object *obj);
-
 /* Object array handling .. */
 void add_object_array(struct object *obj, const char *name, struct object_array *array);
 void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode);
Signature · 1 line
1.5.5.4