Merge branch 'ms/core-icase-doc'
[gitweb.git] / sha1-array.c
index 466a926aa3c7794c73c76c9c94ecfa4d62a20ad4..265941fbf40d4a6c64bb1e77b2aef7a5950493a7 100644 (file)
@@ -41,6 +41,23 @@ void oid_array_clear(struct oid_array *array)
        array->sorted = 0;
 }
 
+
+int oid_array_for_each(struct oid_array *array,
+                      for_each_oid_fn fn,
+                      void *data)
+{
+       int i;
+
+       /* No oid_array_sort() here! See the api-oid-array.txt docs! */
+
+       for (i = 0; i < array->nr; i++) {
+               int ret = fn(array->oid + i, data);
+               if (ret)
+                       return ret;
+       }
+       return 0;
+}
+
 int oid_array_for_each_unique(struct oid_array *array,
                              for_each_oid_fn fn,
                              void *data)