aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-14 13:11:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-14 13:11:28 +0100
commitfa43e3bfc7a4ca93b3ffcae730b6705bc402a2b5 (patch)
tree9333e5182c927238eaca79c615cb36d7d08d1888 /src/lua/lua_task.c
parentc4572edbf6d6bec6bb031479a9bcd0a3f1cd1bbe (diff)
downloadrspamd-fa43e3bfc7a4ca93b3ffcae730b6705bc402a2b5.tar.gz
rspamd-fa43e3bfc7a4ca93b3ffcae730b6705bc402a2b5.zip
Use hash table instead of tree for urls.
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r--src/lua/lua_task.c8
1 files changed, 3 insertions, 5 deletions
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;
}