Software /
code /
prosody
Changeset
12768:6e3aa3995eab
util.jid: Remove redundant check from split() (micro-optimization?)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 11 Oct 2022 13:33:19 +0100 |
parents | 12767:3b75943fa5c1 |
children | 12769:27e1d4354274 |
files | util/jid.lua |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/util/jid.lua Tue Oct 11 13:31:47 2022 +0100 +++ b/util/jid.lua Tue Oct 11 13:33:19 2022 +0100 @@ -35,8 +35,7 @@ if jid == nil then return; end local node, nodepos = match(jid, "^([^@/]+)@()"); local host, hostpos = match(jid, "^([^@/]+)()", nodepos); - if node ~= nil and host == nil then return nil, nil, nil; end - local resource = match(jid, "^/(.+)$", hostpos); + local resource = host and match(jid, "^/(.+)$", hostpos); if (host == nil) or ((resource == nil) and #jid >= hostpos) then return nil, nil, nil; end return node, host, resource; end