[gnome-initial-setup] gis-page-header: Remove some unnecessary allocations
- From: Will Thompson <wjt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] gis-page-header: Remove some unnecessary allocations
- Date: Tue, 11 Feb 2020 14:02:29 +0000 (UTC)
commit 8479c522a5b25805438c0ff9b4aa3291f9f98990
Author: Philip Withnall <withnall endlessm com>
Date: Thu Feb 6 13:54:52 2020 +0000
gis-page-header: Remove some unnecessary allocations
When handling GObject properties, it’s best to keep things as a `GValue`
for as long as possible, since then it’s safely boxed. This removes a
couple of unnecessary allocations and simplifies cleanup.
This introduces no functional changes.
Signed-off-by: Philip Withnall <withnall endlessm com>
gnome-initial-setup/gis-page-header.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gnome-initial-setup/gis-page-header.c b/gnome-initial-setup/gis-page-header.c
index 0b1a5af..cc73fe7 100644
--- a/gnome-initial-setup/gis-page-header.c
+++ b/gnome-initial-setup/gis-page-header.c
@@ -80,7 +80,6 @@ gis_page_header_get_property (GObject *object,
GParamSpec *pspec)
{
GisPageHeader *header = GIS_PAGE_HEADER (object);
- gchar *icon_name = NULL;
switch (prop_id)
{
@@ -93,8 +92,7 @@ gis_page_header_get_property (GObject *object,
break;
case PROP_ICON_NAME:
- g_object_get (header->icon, "icon-name", &icon_name, NULL);
- g_value_take_string (value, icon_name);
+ g_object_get_property (G_OBJECT (header->icon), "icon-name", value);
break;
case PROP_SHOW_ICON:
@@ -128,7 +126,7 @@ gis_page_header_set_property (GObject *object,
break;
case PROP_ICON_NAME:
- g_object_set (header->icon, "icon-name", g_value_get_string (value), NULL);
+ g_object_set_property (G_OBJECT (header->icon), "icon-name", value);
break;
case PROP_SHOW_ICON:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]