aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-10-11 13:35:09 +0100
committerMatthew Wild <mwild1@gmail.com>2022-10-11 13:35:09 +0100
commit120e01f16248ddc9148b96eef5e061be7ce850be (patch)
tree6c42c8663b388378c5dd8202a35d2a57bb3f744b /util
parent6ae850c963db802a606b2fd11d670e599a43626f (diff)
downloadprosody-120e01f16248ddc9148b96eef5e061be7ce850be.tar.gz
prosody-120e01f16248ddc9148b96eef5e061be7ce850be.zip
util.jid: Simplify boolean logic in conditionals
Diffstat (limited to 'util')
-rw-r--r--util/jid.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/jid.lua b/util/jid.lua
index 3e1336fc..55567ea2 100644
--- a/util/jid.lua
+++ b/util/jid.lua
@@ -90,9 +90,9 @@ local function compare(jid, acl)
-- TODO compare to table of rules?
local jid_node, jid_host, jid_resource = split(jid);
local acl_node, acl_host, acl_resource = split(acl);
- if ((acl_node ~= nil and acl_node == jid_node) or acl_node == nil) and
- ((acl_host ~= nil and acl_host == jid_host) or acl_host == nil) and
- ((acl_resource ~= nil and acl_resource == jid_resource) or acl_resource == nil) then
+ if (acl_node == nil or acl_node == jid_node) and
+ (acl_host == nil or acl_host == jid_host) and
+ (acl_resource == nil or acl_resource == jid_resource) then
return true
end
return false