commit 9d792e5: [Minor] Micro-optimisation

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Mar 23 20:28:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-03-23 20:23:04 +0000
URL: https://github.com/rspamd/rspamd/commit/9d792e5d1dc9375284d963d3e43400d303f41393

[Minor] Micro-optimisation
Suggested by: @citrin

---
 src/plugins/lua/rbl.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index fa543e73d..f1c20fa13 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -662,8 +662,8 @@ local function gen_rbl_callback(rule)
     email_tbl.domain = email_tbl.domain:lower()
     email_tbl.user = email_tbl.user:lower()
 
-    if #email_tbl.domain == 0 or #email_tbl.user == 0 then
-      rspamd_logger.infox(task, "got empty/invalid email: '%s@%s'; skip it in the checks",
+    if email_tbl.domain == '' or email_tbl.user == '' then
+      rspamd_logger.infox(task, "got an email with some empty parts: '%s@%s'; skip it in the checks",
           email_tbl.user, email_tbl.domain)
       return
     end


More information about the Commits mailing list