summaryrefslogtreecommitdiff
path: root/portal
diff options
context:
space:
mode:
authorPhaedrus Leeds <mwleeds@endlessos.org>2020-09-17 13:49:20 -0700
committerAlexander Larsson <alexander.larsson@gmail.com>2020-10-02 15:30:58 +0200
commit55f6abe578b028b9e7d9f933369c8ee9cc35cad9 (patch)
treee2ac34d77370308a6e1b556f64b36a18ed36b356 /portal
parent929fe68f55943c13f81d1f89e52358fe8e821732 (diff)
downloadflatpak-55f6abe578b028b9e7d9f933369c8ee9cc35cad9.tar.gz
Avoid string duplication in FlatpakRef
Allocate a full ref string once per object rather than once per call. This is similar to what we do in flatpak_dir_get_name_cached().
Diffstat (limited to 'portal')
-rw-r--r--portal/flatpak-portal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/portal/flatpak-portal.c b/portal/flatpak-portal.c
index 6213e9a2..4f236e01 100644
--- a/portal/flatpak-portal.c
+++ b/portal/flatpak-portal.c
@@ -1568,7 +1568,7 @@ check_for_updates (PortalFlatpakUpdateMonitor *monitor)
const char *remote_commit;
g_autoptr(GError) error = NULL;
g_autoptr(FlatpakDir) dir = NULL;
- g_autofree char *ref = NULL;
+ const char *ref;
installation_path = update_monitor_get_installation_path (monitor);
@@ -1595,7 +1595,7 @@ check_for_updates (PortalFlatpakUpdateMonitor *monitor)
if (dir == NULL)
return;
- ref = flatpak_ref_format_ref (FLATPAK_REF (installed_ref));
+ ref = flatpak_ref_format_ref_cached (FLATPAK_REF (installed_ref));
if (flatpak_dir_ref_is_masked (dir, ref))
return; /* Never report updates for masked refs */