return 0;
}
-static long write_catalog(const char *database, Hashmap *h, struct strbuf *sb,
+static long write_catalog(const char *database, struct strbuf *sb,
CatalogItem *items, size_t n) {
CatalogHeader header;
_cleanup_fclose_ FILE *w = NULL;
memcpy(header.signature, CATALOG_SIGNATURE, sizeof(header.signature));
header.header_size = htole64(ALIGN_TO(sizeof(CatalogHeader), 8));
header.catalog_item_size = htole64(sizeof(CatalogItem));
- header.n_items = htole64(hashmap_size(h));
+ header.n_items = htole64(n);
r = -EIO;
assert(n == hashmap_size(h));
qsort_safe(items, n, sizeof(CatalogItem), catalog_compare_func);
- r = write_catalog(database, h, sb, items, n);
+ r = write_catalog(database, sb, items, n);
if (r < 0)
log_error_errno(r, "Failed to write %s: %m", database);
else