+ array_insert(index->entries, entry, i);
+}
+
+static
+void merge_ctf_fs_ds_indexes(struct ctf_fs_ds_index *dest, struct ctf_fs_ds_index *src)
+{
+ guint i;
+
+ for (i = 0; i < src->entries->len; i++) {
+ struct ctf_fs_ds_index_entry *entry =
+ g_ptr_array_index(src->entries, i);
+
+ /*
+ * Ownership of the ctf_fs_ds_index_entry is transferred to
+ * dest.
+ */
+ g_ptr_array_index(src->entries, i) = NULL;
+
+ ds_index_insert_ds_index_entry_sorted(dest, entry);
+ }