[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 01/01: Simplify GHashTable inserts

noreply at xfce.org noreply at xfce.org
Sun Dec 3 20:54:38 CET 2017


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-pulseaudio-plugin.

commit 7214b136599974f16202e9b9a9203623d94b398f
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Dec 3 14:54:32 2017 -0500

    Simplify GHashTable inserts
---
 panel-plugin/pulseaudio-volume.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/panel-plugin/pulseaudio-volume.c b/panel-plugin/pulseaudio-volume.c
index 328d452..c181ae5 100644
--- a/panel-plugin/pulseaudio-volume.c
+++ b/panel-plugin/pulseaudio-volume.c
@@ -359,9 +359,6 @@ pulseaudio_volume_get_sink_list_cb (pa_context         *context,
                                     int                 eol,
                                     void               *userdata)
 {
-  gchar *name = NULL;
-  gchar *description = NULL;
-
   PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
 
   if (i == NULL)
@@ -370,10 +367,7 @@ pulseaudio_volume_get_sink_list_cb (pa_context         *context,
   if (eol > 0)
     return;
 
-  name = g_strdup (i->name);
-  description = g_strdup (i->description);
-
-  g_hash_table_insert (volume->sinks, name, description);
+  g_hash_table_insert (volume->sinks, g_strdup (i->name), g_strdup (i->description));
 }
 
 
@@ -384,9 +378,6 @@ pulseaudio_volume_get_source_list_cb (pa_context           *context,
                                       int                   eol,
                                       void                 *userdata)
 {
-  gchar *name = NULL;
-  gchar *description = NULL;
-
   PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
 
   if (i == NULL)
@@ -399,10 +390,7 @@ pulseaudio_volume_get_source_list_cb (pa_context           *context,
   if (i->monitor_of_sink != PA_INVALID_INDEX)
     return;
 
-  name = g_strdup (i->name);
-  description = g_strdup (i->description);
-
-  g_hash_table_insert (volume->sources, name, description);
+  g_hash_table_insert (volume->sources, g_strdup (i->name), g_strdup (i->description));
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list