Revert "[GIPARSER] - tidy up searching for var args."
authorAlan Knowles <alan@akbkhome.com>
Sat, 3 Apr 2010 06:54:47 +0000 (14:54 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sat, 3 Apr 2010 06:54:47 +0000 (14:54 +0800)
This reverts commit e01555d743ee408c356ca766257af4d29aa6f385.

girepository/girparser.c

index 4b4d1be..bee89ee 100644 (file)
@@ -3195,28 +3195,6 @@ post_filter_toplevel_varargs_functions (GList *list,
   return list;
 }
 
-
-/* 
-  quick look up of node in the list..
-  return null, or a pointer to the list item..
- */
-static GList *
-node_find_in_list(GList *list, const char *name)
-{
-  GList *link;
-  for (link = list;
-       link;
-       link = link->next)
-    {
-      if (!strcmp (name, ((GIrNode *)link->data)->name))
-       return link;
-    }
-  return NULL;
-}
-
-
-
 static GList *
 post_filter_varargs_functions (GList *list, GList ** varargs_callbacks_out)
 {
@@ -3251,16 +3229,19 @@ post_filter_varargs_functions (GList *list, GList ** varargs_callbacks_out)
 
              if (node->type->is_interface)
                {
-       
-                 GList *callback = node_find_in_list(
-                                       varargs_callbacks, 
-                                       ((GIrNode *)callback->data)->name));
-                 if (callback)
-                    {
-                      list = g_list_delete_link (list, link);
-                      function_done = TRUE;
-                    }
-                    
+                 GList *callback;
+                 for (callback = varargs_callbacks;
+                      callback;
+                      callback = callback->next)
+                   {
+                     if (!strcmp (node->type->interface,
+                                  ((GIrNode *)callback->data)->name))
+                       {
+                         list = g_list_delete_link (list, link);
+                         function_done = TRUE;
+                         break;
+                       }
+                   }
                }
            }
        }