commit 2d73e42: [Minor] Use integer instead of number

Vsevolod Stakhov vsevolod at rspamd.com
Wed Aug 3 20:56:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-08-03 21:51:55 +0100
URL: https://github.com/rspamd/rspamd/commit/2d73e42c2ac317b11c11a5a4f6487b9cb581d1be (HEAD -> master)

[Minor] Use integer instead of number

---
 src/lua/lua_task.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index ed7ebcbea..b7a087103 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -2296,7 +2296,7 @@ lua_task_set_pre_result (lua_State * L)
 			}
 
 			if (lua_type (L, 6) == LUA_TNUMBER) {
-				priority = lua_tonumber (L, 6);
+				priority = lua_tointeger(L, 6);
 			}
 
 			if (lua_type (L, 7) == LUA_TSTRING) {
@@ -2338,6 +2338,10 @@ lua_task_set_pre_result (lua_State * L)
 		}
 
 		if (fl_str != NULL) {
+			/*
+			 * TODO: convert to a set of string and split by `,` + add table support
+			 * once this legacy code is migrated to C++
+			 */
 			if (strstr (fl_str, "least") != NULL) {
 				flags |= RSPAMD_PASSTHROUGH_LEAST;
 			}


More information about the Commits mailing list