lib/pull: Drop static delta superblocks references
authorJonathan Lebon <jonathan@jlebon.com>
Mon, 11 Sep 2023 02:14:39 +0000 (22:14 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Mon, 11 Sep 2023 02:17:13 +0000 (22:17 -0400)
We don't need them long-lived anymore. They were just used for reporting
at this point, but we can use the new `static_delta_targets` hash table
size for that now.

src/libostree/ostree-repo-pull-private.h
src/libostree/ostree-repo-pull.c

index 2a0b7f44b18513f891f2c194198227e9939475ef..651c4826f88da0c3f3b03fa4ed4c2de4e2d6af39 100644 (file)
@@ -88,7 +88,7 @@ typedef struct
   GHashTable *signapi_verified_commits; /* Map<checksum,verification> of commits that have been
                                            signapi verified */
   GHashTable *ref_keyring_map;          /* Maps OstreeCollectionRef to keyring remote name */
-  GPtrArray *static_delta_superblocks;
+
   GHashTable *static_delta_targets; /* Set<checksum> of commits fetched via static delta */
 
   GHashTable *expected_commit_sizes;           /* Maps commit checksum to known size */
index 6822028c270c745275ecd037d01d8de96d82626a..f273639e7fc5bbae4da3d4bd1a3fa34a7ca4dfda 100644 (file)
@@ -210,7 +210,7 @@ update_progress (gpointer user_data)
       pull_data->fetched_deltapart_size, "total-delta-part-size", "t",
       pull_data->total_deltapart_size, "total-delta-part-usize", "t",
       pull_data->total_deltapart_usize, "total-delta-superblocks", "u",
-      pull_data->static_delta_superblocks->len,
+      g_hash_table_size (pull_data->static_delta_targets),
       /* We fetch metadata before content.  These allow us to report metadata fetch progress
          specifically. */
       "outstanding-metadata-fetches", "u", pull_data->n_outstanding_metadata_fetches,
@@ -2469,7 +2469,6 @@ on_superblock_fetched (GObject *src, GAsyncResult *res, gpointer data)
       delta_superblock = g_variant_ref_sink (g_variant_new_from_bytes (
           (GVariantType *)OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT, delta_superblock_data, FALSE));
 
-      g_ptr_array_add (pull_data->static_delta_superblocks, g_variant_ref (delta_superblock));
       g_hash_table_add (pull_data->static_delta_targets, g_strdup (to_revision));
       if (!process_one_static_delta (pull_data, from_revision, to_revision, delta_superblock,
                                      fetch_data->requested_ref, pull_data->cancellable, error))
@@ -4052,8 +4051,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base
         need_summary = TRUE;
     }
 
-  pull_data->static_delta_superblocks
-      = g_ptr_array_new_with_free_func ((GDestroyNotify)g_variant_unref);
   pull_data->static_delta_targets
       = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, NULL);
 
@@ -4910,7 +4907,6 @@ out:
   g_clear_pointer (&pull_data->summary_data_sig, g_bytes_unref);
   g_clear_pointer (&pull_data->summary_sig_etag, g_free);
   g_clear_pointer (&pull_data->summary, g_variant_unref);
-  g_clear_pointer (&pull_data->static_delta_superblocks, g_ptr_array_unref);
   g_clear_pointer (&pull_data->static_delta_targets, g_hash_table_unref);
   g_clear_pointer (&pull_data->commit_to_depth, g_hash_table_unref);
   g_clear_pointer (&pull_data->expected_commit_sizes, g_hash_table_unref);