aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-13 15:28:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-13 15:28:07 +0100
commit6f70b5767167f3414ee7c84346e84f32ebfeaf38 (patch)
tree1448f57c9730837667f5da5f037832b970e17993 /src/lua
parent7a1cfea11cf27eea852be68b2373b233e650f689 (diff)
downloadrspamd-6f70b5767167f3414ee7c84346e84f32ebfeaf38.tar.gz
rspamd-6f70b5767167f3414ee7c84346e84f32ebfeaf38.zip
More fixes for the new symbols structure.
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_cfg_file.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c
index a8e8dfbb8..049118504 100644
--- a/src/lua/lua_cfg_file.c
+++ b/src/lua/lua_cfg_file.c
@@ -40,7 +40,7 @@ static void
lua_process_metric (lua_State *L, const gchar *name, struct rspamd_config *cfg)
{
GList *metric_list;
- gchar *symbol, *old_desc;
+ gchar *symbol;
const gchar *desc;
struct metric *metric;
gdouble *score;
@@ -75,20 +75,7 @@ lua_process_metric (lua_State *L, const gchar *name, struct rspamd_config *cfg)
lua_gettable (L, -2);
if (lua_isstring (L, -1)) {
desc = lua_tostring (L, -1);
- old_desc =
- g_hash_table_lookup (metric->descriptions, symbol);
- if (old_desc) {
- msg_info ("replacing description for symbol %s",
- symbol);
- g_hash_table_replace (metric->descriptions,
- symbol,
- rspamd_mempool_strdup (cfg->cfg_pool, desc));
- }
- else {
- g_hash_table_insert (metric->descriptions,
- symbol,
- rspamd_mempool_strdup (cfg->cfg_pool, desc));
- }
+ s->description = rspamd_mempool_strdup (cfg->cfg_pool, desc);
}
lua_pop (L, 1);
}