# HG changeset patch # User Kim Alvefur # Date 1407426208 -7200 # Node ID 7e820979fd9b2ae6d9f54e7102003fd3a55af782 # Parent 1c19464cde77f3cc1aca8bacde280f2fb4403ca6 util.jid: Optimize bare diff -r 1c19464cde77 -r 7e820979fd9b util/jid.lua --- a/util/jid.lua Thu Aug 07 17:35:11 2014 +0200 +++ b/util/jid.lua Thu Aug 07 17:43:28 2014 +0200 @@ -37,11 +37,7 @@ split = _split; function bare(jid) - local node, host = _split(jid); - if node and host then - return node.."@"..host; - end - return host; + return jid and match(jid, "^[^/]+"); end local function _prepped_split(jid)