[Nice] [nice/master] Remove useless check on g_slist_remove (it doesnt allocate anything!)

Olivier Crête olivier.crete at collabora.co.uk
Wed Nov 5 14:02:14 PST 2008


---
 agent/discovery.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/agent/discovery.c b/agent/discovery.c
index ec860ec..a53adb2 100644
--- a/agent/discovery.c
+++ b/agent/discovery.c
@@ -105,29 +105,20 @@ void discovery_free (NiceAgent *agent)
  */
 gboolean discovery_prune_stream (NiceAgent *agent, guint stream_id)
 {
-  CandidateDiscovery *cand;
   GSList *i;
 
   for (i = agent->discovery_list; i ; ) {
-    cand = i->data;
+    CandidateDiscovery *cand = i->data;
+    GSList *next = i->next;
 
     if (cand->stream->id == stream_id) {
-      GSList *next = i->next;
-      agent->discovery_list = 
-	g_slist_remove (agent->discovery_list, cand);
+      agent->discovery_list = g_slist_remove (agent->discovery_list, cand);
       discovery_free_item (cand, NULL);
-      i = next;
-      if (!agent->discovery_list)
-	break;
     }
-    else
-      i = i->next;
+    i = next;
   }
 
   if (agent->discovery_list == NULL) {
-    /* return FALSE if there was a memory allocation failure */
-    if (i != NULL)
-      return FALSE;
     /* noone using the timer anymore, clean it up */
     discovery_free (agent);
   }
-- 
1.5.6.5




More information about the Nice mailing list