[gnome-software] Only set the management plugin on an app if it differs
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Only set the management plugin on an app if it differs
- Date: Mon, 27 Jun 2016 09:39:48 +0000 (UTC)
commit b8e42e5b268b19ecdfcaedb226dd1eaff38ed014
Author: Joaquim Rocha <jrocha endlessm com>
Date: Tue Jun 14 13:53:33 2016 +0200
Only set the management plugin on an app if it differs
This skips freeing+allocating new memory for storing the same content.
src/gs-app.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 3a3e0e6..d59547a 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1855,6 +1855,10 @@ void
gs_app_set_management_plugin (GsApp *app, const gchar *management_plugin)
{
g_return_if_fail (GS_IS_APP (app));
+
+ if (g_strcmp0 (app->management_plugin, management_plugin) == 0)
+ return;
+
g_free (app->management_plugin);
app->management_plugin = g_strdup (management_plugin);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]