[gnome-desktop] gnome-rr-config: Remove checks around g_strdup
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] gnome-rr-config: Remove checks around g_strdup
- Date: Thu, 8 Jan 2015 23:04:09 +0000 (UTC)
commit d0673a1c41a3d0021940d13cc6508c719220c4e7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jan 8 14:35:24 2015 -0800
gnome-rr-config: Remove checks around g_strdup
g_strdup already handles NULLs just fine.
libgnome-desktop/gnome-rr-config.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index e6de41f..f739ecd 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -423,16 +423,12 @@ make_outputs (GnomeRRConfig *config)
GnomeRROutputInfo *old = config->priv->outputs[i];
GnomeRROutputInfo *new = g_object_new (GNOME_TYPE_RR_OUTPUT_INFO, NULL);
*(new->priv) = *(old->priv);
- if (old->priv->name)
- new->priv->name = g_strdup (old->priv->name);
- if (old->priv->display_name)
- new->priv->display_name = g_strdup (old->priv->display_name);
- if (old->priv->vendor)
- new->priv->vendor = g_strdup (old->priv->vendor);
- if (old->priv->product)
- new->priv->product = g_strdup (old->priv->product);
- if (old->priv->serial)
- new->priv->serial = g_strdup (old->priv->serial);
+
+ new->priv->name = g_strdup (old->priv->name);
+ new->priv->display_name = g_strdup (old->priv->display_name);
+ new->priv->vendor = g_strdup (old->priv->vendor);
+ new->priv->product = g_strdup (old->priv->product);
+ new->priv->serial = g_strdup (old->priv->serial);
if (old->priv->on && !first_on)
first_on = old;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]