[gnome-control-center] network: Remove an unnecessary goto
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Remove an unnecessary goto
- Date: Tue, 1 Oct 2019 02:35:27 +0000 (UTC)
commit bf8b8f52b71f3822c252ec934832b93da16beff6
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Oct 1 14:52:13 2019 +1300
network: Remove an unnecessary goto
panels/network/panel-common.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/panels/network/panel-common.c b/panels/network/panel-common.c
index e895c5006..034efe260 100644
--- a/panels/network/panel-common.c
+++ b/panels/network/panel-common.c
@@ -337,8 +337,6 @@ panel_set_device_widget_details (GtkLabel *heading,
gchar *
panel_get_ip4_address_as_string (NMIPConfig *ip4_config, const char *what)
{
- const gchar *str = NULL;
-
/* we only care about one address */
if (!strcmp (what, "address")) {
GPtrArray *array;
@@ -346,15 +344,14 @@ panel_get_ip4_address_as_string (NMIPConfig *ip4_config, const char *what)
array = nm_ip_config_get_addresses (ip4_config);
if (array->len < 1)
- goto out;
+ return NULL;
address = array->pdata[0];
- str = nm_ip_address_get_address (address);
+ return g_strdup (nm_ip_address_get_address (address));
} else if (!strcmp (what, "gateway")) {
- str = nm_ip_config_get_gateway (ip4_config);
+ return g_strdup (nm_ip_config_get_gateway (ip4_config));
}
-out:
- return g_strdup (str);
+ return NULL;
}
gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]