[PATCH] libICE: Don't use _IceTransIsLocal in IceComposeNetworkList

Jesse Adkins jesse_adkins7 at yahoo.com
Tue Jun 2 10:15:09 PDT 2009


This saves an extra loop from firing off when there's a non-local socket among the connections. (Since all _IceTransLocal does is check if the socket is a UNIX type.)

diff --git a/src/listen.c b/src/listen.c
index eb46f87..efd85bd 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -207,27 +207,10 @@ IceComposeNetworkIdList (
 
     for (i = 0; i < count; i++)
     {
-        if (_IceTransIsLocal (listenObjs[i]->trans_conn))
-        {
-        strcat (list, listenObjs[i]->network_id);
-        doneCount++;
-        if (doneCount < count)
-            strcat (list, ",");
-        }
-    }
-
-    if (doneCount < count)
-    {
-        for (i = 0; i < count; i++)
-        {
-        if (!_IceTransIsLocal (listenObjs[i]->trans_conn))
-        {
-            strcat (list, listenObjs[i]->network_id);
-            doneCount++;
-            if (doneCount < count)
-            strcat (list, ",");
-        }
-        }
+        strcat (list, listenObjs[i]->network_id);
+        doneCount++;
+        if (doneCount < count)
+        strcat (list, ",");
     }
 
     return (list);



      



More information about the xorg mailing list