On Thu, 2009-04-02 at 14:23 +0200, Philip Van Hoof wrote:
> I'm not very sure, but isn't this going to make things faster?
> 
> Let me know ...

Added a break, don't know why we would need to continue looping once
found.

-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be
Index: src/trackerd/tracker-monitor.c
===================================================================
--- src/trackerd/tracker-monitor.c	(revision 3163)
+++ src/trackerd/tracker-monitor.c	(working copy)
@@ -493,21 +493,21 @@
 		      GFile	 *file)
 {
 	GHashTable  *hash_table;
-	GList	    *all_modules, *l;
+	GHashTableIter iter;
+	gpointer key, value;
 	const gchar *module_name = NULL;
 
-	all_modules = g_hash_table_get_keys (modules);
+	g_hash_table_iter_init (&iter, modules);
 
-	for (l = all_modules; l && !module_name; l = l->next) {
-		hash_table = g_hash_table_lookup (modules, l->data);
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		hash_table = (GHashTable *) value;
 
 		if (g_hash_table_lookup (hash_table, file)) {
-			module_name = l->data;
+			module_name = (const gchar *) key;
+			break;
 		}
 	}
 
-	g_list_free (all_modules);
-
 	return module_name;
 }
 
_______________________________________________
tracker-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to