From fa43e3bfc7a4ca93b3ffcae730b6705bc402a2b5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 14 Apr 2015 13:11:28 +0100 Subject: Use hash table instead of tree for urls. --- src/lua/lua_task.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lua/lua_task.c') diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index ae6780245..4d9f44cee 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -813,7 +813,7 @@ struct lua_tree_cb_data { int i; }; -static gboolean +static void lua_tree_url_callback (gpointer key, gpointer value, gpointer ud) { struct rspamd_url **purl; @@ -823,8 +823,6 @@ lua_tree_url_callback (gpointer key, gpointer value, gpointer ud) rspamd_lua_setclass (cb->L, "rspamd{url}", -1); *purl = value; lua_rawseti (cb->L, -2, cb->i++); - - return FALSE; } static gint @@ -837,7 +835,7 @@ lua_task_get_urls (lua_State * L) lua_newtable (L); cb.i = 1; cb.L = L; - g_tree_foreach (task->urls, lua_tree_url_callback, &cb); + g_hash_table_foreach (task->urls, lua_tree_url_callback, &cb); return 1; } @@ -874,7 +872,7 @@ lua_task_get_emails (lua_State * L) lua_newtable (L); cb.i = 1; cb.L = L; - g_tree_foreach (task->emails, lua_tree_url_callback, &cb); + g_hash_table_foreach (task->emails, lua_tree_url_callback, &cb); return 1; } -- cgit v1.2.3