Update draft release notes for 1.8.4
[gitweb.git] / object.h
index 0d39ff4f9d16e1b33be42acb3e1af209a6cd4e42..2ff68c52dd48842a188eb8f0c9b1e12ff27fae37 100644 (file)
--- a/object.h
+++ b/object.h
@@ -11,7 +11,13 @@ struct object_array {
        unsigned int alloc;
        struct object_array_entry {
                struct object *item;
-               const char *name;
+               /*
+                * name or NULL.  If non-NULL, the memory pointed to
+                * is owned by this object *except* if it points at
+                * object_array_slopbuf, which is a static copy of the
+                * empty string.
+                */
+               char *name;
                unsigned mode;
        } *objects;
 };
@@ -96,7 +102,11 @@ typedef int (*object_array_each_func_t)(struct object_array_entry *, void *);
 void object_array_filter(struct object_array *array,
                         object_array_each_func_t want, void *cb_data);
 
-void object_array_remove_duplicates(struct object_array *);
+/*
+ * Remove from array all but the first entry with a given name.
+ * Warning: this function uses an O(N^2) algorithm.
+ */
+void object_array_remove_duplicates(struct object_array *array);
 
 void clear_object_flags(unsigned flags);