commit 0eee052: [Minor] Remove unused-but-set variables
Christian Göttsche
cgzones at googlemail.com
Tue Apr 14 09:56:09 UTC 2020
Author: Christian Göttsche
Date: 2020-04-06 16:27:38 +0200
URL: https://github.com/rspamd/rspamd/commit/0eee0523918a72f45bf3ffe3cd42c3182ed6f95e
[Minor] Remove unused-but-set variables
../src/libserver/url.c: In function ‘rspamd_url_host_set_add’:
../src/libserver/url.c:3808:11: warning: variable ‘k’ set but not used [-Wunused-but-set-variable]
3808 | khiter_t k;
| ^
../src/lua/lua_task.c: In function ‘lua_task_has_urls’:
../src/lua/lua_task.c:2406:11: warning: variable ‘need_emails’ set but not used [-Wunused-but-set-variable]
2406 | gboolean need_emails = FALSE, ret = FALSE;
| ^~~~~~~~~~~
---
src/libserver/url.c | 5 ++---
src/lua/lua_task.c | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/libserver/url.c b/src/libserver/url.c
index 6aceb8fa6..db89073f5 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -3941,11 +3941,10 @@ bool
rspamd_url_host_set_add (khash_t (rspamd_url_host_hash) *set,
struct rspamd_url *u)
{
- khiter_t k;
gint r;
if (set) {
- k = kh_put (rspamd_url_host_hash, set, u, &r);
+ kh_put (rspamd_url_host_hash, set, u, &r);
if (r == 0) {
return false;
@@ -3991,4 +3990,4 @@ rspamd_url_host_set_has (khash_t (rspamd_url_host_hash) *set, struct rspamd_url
}
return false;
-}
\ No newline at end of file
+}
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 2d6257443..6f1eeaf3f 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -2423,13 +2423,13 @@ lua_task_has_urls (lua_State * L)
{
LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
- gboolean need_emails = FALSE, ret = FALSE;
+ gboolean ret = FALSE;
gsize sz = 0;
if (task) {
if (task->message) {
if (lua_gettop (L) >= 2) {
- need_emails = lua_toboolean (L, 2);
+ lua_toboolean (L, 2);
}
if (kh_size (MESSAGE_FIELD (task, urls)) > 0) {
More information about the Commits
mailing list